@alexkroman1/aai-ui 5.13.2 → 6.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.
Files changed (57) hide show
  1. package/README.md +2 -1
  2. package/dist/_repeat-until.d.ts +30 -0
  3. package/dist/_sse.d.ts +56 -0
  4. package/dist/_workflow-api-ref.d.ts +37 -0
  5. package/dist/audio.js +26 -26
  6. package/dist/{chat-view-DadZOvJO.js → chat-view-CK61bWWx.js} +4 -3
  7. package/dist/components/_form-values.d.ts +19 -0
  8. package/dist/components/auto-scroll.d.ts +63 -0
  9. package/dist/components/chat-view.js +1 -1
  10. package/dist/components/controls.js +1 -1
  11. package/dist/components/form-types.d.ts +67 -0
  12. package/dist/components/form.d.ts +138 -0
  13. package/dist/components/message-list.js +1 -1
  14. package/dist/components/start-screen.js +1 -1
  15. package/dist/components/tool-call-block.js +1 -1
  16. package/dist/components/workflow-fields.d.ts +57 -0
  17. package/dist/components/workflow-progress.d.ts +55 -0
  18. package/dist/default-client/assets/audio-fO7SVU64.js +1 -0
  19. package/dist/default-client/assets/{capture-processor-CWRLCPS3.js → capture-processor-Dmc-KEpb.js} +4 -4
  20. package/dist/default-client/assets/client-audio-constants-Ck0IJO4c.js +1 -0
  21. package/dist/default-client/assets/index-4u908fff.js +293 -0
  22. package/dist/default-client/assets/index-CDugAuLK.css +2 -0
  23. package/dist/default-client/assets/{playback-processor-SKKE9qu2.js → playback-processor-DUsmALNH.js} +10 -3
  24. package/dist/default-client/index.html +3 -2
  25. package/dist/define-client.d.ts +40 -1
  26. package/dist/define-client.js +61 -19
  27. package/dist/hooks.d.ts +30 -0
  28. package/dist/hooks.js +4 -26
  29. package/dist/index.d.ts +11 -0
  30. package/dist/index.js +1597 -7
  31. package/dist/{message-list-YdLocGoT.js → message-list-BwA3rdPi.js} +105 -27
  32. package/dist/page.d.ts +88 -0
  33. package/dist/{session-core-BA8H3qtF.js → session-core-ClKdVgRU.js} +245 -112
  34. package/dist/session-core-dial.d.ts +38 -0
  35. package/dist/session-core-handshake.d.ts +16 -1
  36. package/dist/session-core-messages.d.ts +2 -2
  37. package/dist/session-core-reconnect.d.ts +2 -7
  38. package/dist/session-core.js +1 -1
  39. package/dist/session-resume-store.d.ts +43 -0
  40. package/dist/types.d.ts +1 -1
  41. package/dist/types.js +1 -1
  42. package/dist/use-user-transcript.d.ts +70 -0
  43. package/dist/use-workflow-form.d.ts +136 -0
  44. package/dist/use-workflow-progress.d.ts +100 -0
  45. package/dist/use-workflow-run.d.ts +56 -0
  46. package/dist/use-workflow-runs.d.ts +71 -0
  47. package/dist/workflow-client.d.ts +97 -0
  48. package/dist/workflow-events.d.ts +39 -0
  49. package/dist/worklets/playback-processor.d.ts +1 -1
  50. package/dist/worklets/playback-processor.js +8 -1
  51. package/package.json +9 -8
  52. package/dist/default-client/assets/audio-BqyrSHNq.js +0 -1
  53. package/dist/default-client/assets/index-Ctjrde3-.css +0 -2
  54. package/dist/default-client/assets/index-DfVI-qZ8.js +0 -293
  55. package/dist/{aai-logo-B8lDmsut.js → aai-logo-9xRBGVFl.js} +1 -1
  56. package/dist/{controls-DzQEKq9c.js → controls-Cy_YVfsa.js} +1 -1
  57. package/dist/{tool-call-block-CAscLGFy.js → tool-call-block-CrLN7xlI.js} +1 -1
@@ -0,0 +1,2 @@
1
+ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--font-aai:"Monument Grotesk", "ABC Monument Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;--font-aai-serif:"Source Serif 4", "Source Serif Pro", Charter, "Iowan Old Style", Georgia, serif;--font-aai-mono:"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;--radius-aai:4px}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html,body{margin:0;padding:0}}@layer components;@layer utilities{.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.order-last{order:9999}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-auto{margin-inline:auto}.my-0\.5{margin-block:calc(var(--spacing) * .5)}.my-1\.5{margin-block:calc(var(--spacing) * 1.5)}.my-2\.5{margin-block:calc(var(--spacing) * 2.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.box-border{box-sizing:border-box}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-4{height:calc(var(--spacing) * 4)}.h-9{height:calc(var(--spacing) * 9)}.h-11{height:calc(var(--spacing) * 11)}.h-\[7px\]{height:7px}.h-full{height:100%}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[40vh\]{max-height:40vh}.min-h-0{min-height:0}.min-h-5{min-height:calc(var(--spacing) * 5)}.min-h-screen{min-height:100vh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-4{width:calc(var(--spacing) * 4)}.w-\[7px\]{width:7px}.w-fit{width:fit-content}.w-full{width:100%}.max-w-75{max-width:calc(var(--spacing) * 75)}.max-w-105{max-width:calc(var(--spacing) * 105)}.max-w-190{max-width:calc(var(--spacing) * 190)}.max-w-\[82\%\]{max-width:82%}.max-w-\[min\(78\%\,64ch\)\]{max-width:min(78%,64ch)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.\[scrollbar-width\:none\]{scrollbar-width:none}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-aai{border-radius:var(--radius-aai)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-\(--aai-btn-bd\){border-color:var(--aai-btn-bd)}.bg-\(--aai-btn-bg\){background-color:var(--aai-btn-bg)}.bg-transparent{background-color:#0000}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-7{padding:calc(var(--spacing) * 7)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-7{padding-inline:calc(var(--spacing) * 7)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pl-1\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-aai{font-family:var(--font-aai)}.font-aai-mono{font-family:var(--font-aai-mono)}.font-aai-serif{font-family:var(--font-aai-serif)}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[22px\]{font-size:22px}.text-\[32px\]{font-size:32px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-\[1\.2\]{--tw-leading:1.2;line-height:1.2}.leading-\[1\.15\]{--tw-leading:1.15;line-height:1.15}.leading-\[22px\]{--tw-leading:22px;line-height:22px}.leading-\[23px\]{--tw-leading:23px;line-height:23px}.leading-\[130\%\]{--tw-leading:130%;line-height:130%}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[-0\.2px\]{--tw-tracking:-.2px;letter-spacing:-.2px}.tracking-\[1\.2px\]{--tw-tracking:1.2px;letter-spacing:1.2px}.tracking-\[1\.4px\]{--tw-tracking:1.4px;letter-spacing:1.4px}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.text-balance{text-wrap:balance}.wrap-break-word{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\(--aai-btn-fg\){color:var(--aai-btn-fg)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.file\:mr-3::file-selector-button{margin-right:calc(var(--spacing) * 3)}.file\:cursor-pointer::file-selector-button{cursor:pointer}.file\:rounded-aai::file-selector-button{border-radius:var(--radius-aai)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:px-3::file-selector-button{padding-inline:calc(var(--spacing) * 3)}.file\:py-1\.5::file-selector-button{padding-block:calc(var(--spacing) * 1.5)}.file\:font-aai::file-selector-button{font-family:var(--font-aai)}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:\[color\:var\(--aai-file-button-fg\)\]::file-selector-button{color:var(--aai-file-button-fg)}.file\:\[background\:var\(--aai-file-button-bg\)\]::file-selector-button{background:var(--aai-file-button-bg)}.first\:mt-0:first-child{margin-top:0}.last\:mb-0:last-child{margin-bottom:0}.focus-visible\:\[outline\:2px_solid\]:focus-visible{outline:2px solid}.focus-visible\:\[outline-offset\:2px\]:focus-visible{outline-offset:2px}@media (hover:hover){.enabled\:hover\:border-\(--aai-btn-bd-hover\):enabled:hover{border-color:var(--aai-btn-bd-hover)}.enabled\:hover\:bg-\(--aai-btn-bg-hover\):enabled:hover{background-color:var(--aai-btn-bg-hover)}.enabled\:hover\:text-\(--aai-btn-fg-hover\):enabled:hover{color:var(--aai-btn-fg-hover)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:ml-auto{margin-left:auto}.sm\:max-w-\[60\%\]{max-width:60%}.sm\:basis-auto{flex-basis:auto}.sm\:px-16{padding-inline:calc(var(--spacing) * 16)}.sm\:py-14{padding-block:calc(var(--spacing) * 14)}}@media (width>=48rem){.md\:order-none{order:0}.md\:h-screen{height:100vh}.md\:max-h-none{max-height:none}.md\:w-\(--aai-sidebar-w\){width:var(--aai-sidebar-w)}.md\:flex-row{flex-direction:row}.md\:border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.md\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.md\:border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.md\:border-l{border-left-style:var(--tw-border-style);border-left-width:1px}}}@keyframes aai-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.45;transform:scale(.82)}}@keyframes aai-bounce{0%,80%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}@keyframes aai-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.tool-shimmer{-webkit-text-fill-color:transparent;background:linear-gradient(90deg,currentColor 25%,#0000 50%,currentColor 75%) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;animation:2s infinite aai-shimmer}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}
@@ -1,4 +1,4 @@
1
- import{i as e}from"./index-DfVI-qZ8.js";import{t}from"./_module-url-BX0RuRU2.js";var n=t(`
1
+ import{a as e}from"./client-audio-constants-Ck0IJO4c.js";import{t}from"./_module-url-BX0RuRU2.js";var n=`
2
2
  class PlaybackProcessor extends AudioWorkletProcessor {
3
3
  constructor(options) {
4
4
  super();
@@ -7,6 +7,13 @@ class PlaybackProcessor extends AudioWorkletProcessor {
7
7
  // so the worklet-global sampleRate is authoritative; the option exists
8
8
  // for the node-less test harness.
9
9
  const rate = opts.sampleRate ?? sampleRate;
10
+ // Kept, because every derived quantity below reads it and \`bufferedMs\` in
11
+ // process() is the one that used to read the worklet global instead. Those
12
+ // agree in production (the option is unset, so \`rate\` IS \`sampleRate\`) and
13
+ // diverge only in the node-less harness — which is the one place a spec
14
+ // could ever assert on the reported backlog, so the divergence made the
15
+ // number untestable rather than wrong.
16
+ this.rate = rate;
10
17
  // Fill target for the start of a turn. If 'done' arrives first (short
11
18
  // utterance), start immediately instead of waiting for audio that is
12
19
  // never coming.
@@ -254,7 +261,7 @@ class PlaybackProcessor extends AudioWorkletProcessor {
254
261
  if (this.sinceReportSamples >= this.reportIntervalSamples) {
255
262
  this.sinceReportSamples = 0;
256
263
  if (avail > 0) {
257
- this.port.postMessage({ event: 'progress', bufferedMs: (avail / sampleRate) * 1000 });
264
+ this.port.postMessage({ event: 'progress', bufferedMs: (avail / this.rate) * 1000 });
258
265
  }
259
266
  }
260
267
 
@@ -308,4 +315,4 @@ class PlaybackProcessor extends AudioWorkletProcessor {
308
315
  }
309
316
 
310
317
  registerProcessor('playback-processor', PlaybackProcessor);
311
- `);export{n as default};
318
+ `,r=t(n);export{r as default};
@@ -6,8 +6,9 @@
6
6
  <title>aai</title>
7
7
  <link rel="icon" href="./favicon.ico" />
8
8
  <style>html, body { background: #FBF8F2; margin: 0; }</style>
9
- <script type="module" crossorigin src="./assets/index-DfVI-qZ8.js"></script>
10
- <link rel="stylesheet" crossorigin href="./assets/index-Ctjrde3-.css">
9
+ <script type="module" crossorigin src="./assets/index-4u908fff.js"></script>
10
+ <link rel="modulepreload" crossorigin href="./assets/client-audio-constants-Ck0IJO4c.js">
11
+ <link rel="stylesheet" crossorigin href="./assets/index-CDugAuLK.css">
11
12
  </head>
12
13
  <body>
13
14
  <main id="app"></main>
@@ -1,5 +1,5 @@
1
1
  /** @jsxImportSource react */
2
- import { type ComponentType } from "react";
2
+ import { type ComponentType, type ReactNode } from "react";
3
3
  import { type ToolDisplayConfig } from "./components/tool-config-context.ts";
4
4
  import type { SessionCore } from "./session-core-types.ts";
5
5
  import type { ClientTheme, VoiceSessionOptions } from "./types.ts";
@@ -99,6 +99,45 @@ export type ClientHandle = {
99
99
  /** Alias for `dispose` for use with `using`. */
100
100
  [Symbol.dispose](): void;
101
101
  };
102
+ /**
103
+ * The element a mount renders into.
104
+ *
105
+ * Exported so `page()` resolves its target the same way `client()` does — the
106
+ * default selector and the "element not found" sentence are part of what an
107
+ * author has learned, and a second copy is how the two mounts come to disagree
108
+ * about which one they were given.
109
+ *
110
+ * @internal
111
+ */
112
+ export declare function resolveContainer(target?: string | HTMLElement): HTMLElement;
113
+ /**
114
+ * What a mount hands back: unmount, and `using` support.
115
+ *
116
+ * @internal
117
+ */
118
+ export type MountedRoot = {
119
+ /** Unmount the React tree (and, for `client()`, dispose the session). */
120
+ dispose(): void;
121
+ /** Alias for `dispose` for use with `using`. */
122
+ [Symbol.dispose](): void;
123
+ };
124
+ /**
125
+ * Render `node` into `container` and hand back its teardown.
126
+ *
127
+ * Shared by {@link client} and `page()` because the plumbing is identical and
128
+ * the two decisions in it are not obvious enough to be re-derived: the root is
129
+ * created here rather than by the caller so nothing else can hold one, and the
130
+ * render is `flushSync` so the mount is observable to the caller's NEXT
131
+ * STATEMENT (and to a test) rather than scheduled — `client()` returns a handle
132
+ * whose session is expected to be live, and `page()` returns one a caller may
133
+ * dispose immediately.
134
+ *
135
+ * `onDispose` runs after the unmount, which is the order `client()` needs: the
136
+ * tree comes down before the session under it goes away.
137
+ *
138
+ * @internal
139
+ */
140
+ export declare function mountRoot(container: HTMLElement, node: ReactNode, onDispose?: () => void): MountedRoot;
102
141
  /**
103
142
  * Define and mount a client UI for a voice agent.
104
143
  *
@@ -1,16 +1,26 @@
1
- import { r as fetchClientConfig, t as createSessionCore } from "./session-core-BA8H3qtF.js";
1
+ import { r as fetchClientConfig, t as createSessionCore } from "./session-core-ClKdVgRU.js";
2
2
  import { SessionProvider, ThemeProvider } from "./context.js";
3
- import { t as ChatView } from "./chat-view-DadZOvJO.js";
3
+ import { t as ChatView } from "./chat-view-CK61bWWx.js";
4
4
  import { t as pageBaseUrl } from "./_utils-CsqbIVGI.js";
5
- import { n as ToolConfigContext } from "./tool-call-block-CAscLGFy.js";
5
+ import { n as ToolConfigContext } from "./tool-call-block-CrLN7xlI.js";
6
6
  import { SidebarLayout } from "./components/sidebar-layout.js";
7
7
  import { StartScreen } from "./components/start-screen.js";
8
- import { createElement, useEffect, useState } from "react";
9
8
  import { jsx } from "react/jsx-runtime";
9
+ import { createElement, useEffect, useState } from "react";
10
10
  import { flushSync } from "react-dom";
11
11
  import { createRoot } from "react-dom/client";
12
12
  //#region define-client.tsx
13
13
  /** @jsxImportSource react */
14
+ /**
15
+ * The element a mount renders into.
16
+ *
17
+ * Exported so `page()` resolves its target the same way `client()` does — the
18
+ * default selector and the "element not found" sentence are part of what an
19
+ * author has learned, and a second copy is how the two mounts come to disagree
20
+ * about which one they were given.
21
+ *
22
+ * @internal
23
+ */
14
24
  function resolveContainer(target = "#app") {
15
25
  if (typeof target !== "string") return target;
16
26
  const el = document.querySelector(target);
@@ -18,6 +28,37 @@ function resolveContainer(target = "#app") {
18
28
  return el;
19
29
  }
20
30
  /**
31
+ * Render `node` into `container` and hand back its teardown.
32
+ *
33
+ * Shared by {@link client} and `page()` because the plumbing is identical and
34
+ * the two decisions in it are not obvious enough to be re-derived: the root is
35
+ * created here rather than by the caller so nothing else can hold one, and the
36
+ * render is `flushSync` so the mount is observable to the caller's NEXT
37
+ * STATEMENT (and to a test) rather than scheduled — `client()` returns a handle
38
+ * whose session is expected to be live, and `page()` returns one a caller may
39
+ * dispose immediately.
40
+ *
41
+ * `onDispose` runs after the unmount, which is the order `client()` needs: the
42
+ * tree comes down before the session under it goes away.
43
+ *
44
+ * @internal
45
+ */
46
+ function mountRoot(container, node, onDispose) {
47
+ const root = createRoot(container);
48
+ flushSync(() => {
49
+ root.render(node);
50
+ });
51
+ return {
52
+ dispose() {
53
+ root.unmount();
54
+ onDispose?.();
55
+ },
56
+ [Symbol.dispose]() {
57
+ this.dispose();
58
+ }
59
+ };
60
+ }
61
+ /**
21
62
  * Default shell rendered in config tier.
22
63
  * Wraps StartScreen → (SidebarLayout →) ChatView.
23
64
  */
@@ -38,10 +79,22 @@ function DefaultShell({ name, Sidebar, sidebarWidth }) {
38
79
  * immediately — optimistically — while the lookup is in flight; servers
39
80
  * without the endpoint (every lookup failure resolves to the empty default)
40
81
  * work exactly as before.
82
+ *
83
+ * **The lookup is SKIPPED when the caller already named the agent.** The
84
+ * response's only consumer here is the fallback below, so with an explicit
85
+ * `client({ name })` the request was issued and its answer thrown away — and on
86
+ * the platform this endpoint is the BROKER, so the discarded request is one that
87
+ * can boot a sandbox. The session's own per-attempt lookup
88
+ * (`session-core.ts`'s URL provider) is a different question and deliberately
89
+ * left alone: it re-brokers on every connection attempt, which is what makes a
90
+ * reconnect land on a REPLACEMENT sandbox, so it may not be served from
91
+ * anything this render already has.
41
92
  */
42
93
  function DefaultRoot({ platformUrl, name, Sidebar, sidebarWidth }) {
43
94
  const [resolved, setResolved] = useState(null);
95
+ const needsLookup = name === void 0;
44
96
  useEffect(() => {
97
+ if (!needsLookup) return;
45
98
  let cancelled = false;
46
99
  fetchClientConfig(platformUrl).then((cfg) => {
47
100
  if (!cancelled) setResolved(cfg);
@@ -49,7 +102,7 @@ function DefaultRoot({ platformUrl, name, Sidebar, sidebarWidth }) {
49
102
  return () => {
50
103
  cancelled = true;
51
104
  };
52
- }, [platformUrl]);
105
+ }, [platformUrl, needsLookup]);
53
106
  return /* @__PURE__ */ jsx(DefaultShell, {
54
107
  name: name ?? resolved?.name,
55
108
  Sidebar,
@@ -120,21 +173,10 @@ function client(config) {
120
173
  sidebarWidth: config.sidebarWidth
121
174
  });
122
175
  const toolConfig = config.tools ?? {};
123
- const root = createRoot(container);
124
- flushSync(() => {
125
- root.render(createElement(ToolConfigContext.Provider, { value: toolConfig }, createElement(ThemeProvider, { value: config.theme }, createElement(SessionProvider, { value: session }, rootNode))));
126
- });
127
- const handle = {
176
+ return {
128
177
  session,
129
- dispose() {
130
- root.unmount();
131
- session[Symbol.dispose]();
132
- },
133
- [Symbol.dispose]() {
134
- handle.dispose();
135
- }
178
+ ...mountRoot(container, createElement(ToolConfigContext.Provider, { value: toolConfig }, createElement(ThemeProvider, { value: config.theme }, createElement(SessionProvider, { value: session }, rootNode))), () => session[Symbol.dispose]())
136
179
  };
137
- return handle;
138
180
  }
139
181
  //#endregion
140
- export { client };
182
+ export { client, mountRoot, resolveContainer };
package/dist/hooks.d.ts CHANGED
@@ -39,6 +39,36 @@ export declare function useToolResult<R = DefaultToolResult>(callback: (name: st
39
39
  * @public
40
40
  */
41
41
  export declare function useAgentState<S = DefaultToolResult>(): S | null;
42
+ /**
43
+ * The agent's projected session state, falling back to `fallback` before the
44
+ * first push — so the return is never `null` and a sidebar needs no branch for
45
+ * the pre-first-tool-call moment.
46
+ *
47
+ * Build the fallback by running the SAME projection over an empty state, not
48
+ * by hand-writing an empty-looking literal: a field added to the projection
49
+ * then reaches the first render too, instead of being `undefined` only in
50
+ * that one frame.
51
+ *
52
+ * ```tsx no-check
53
+ * // `no-check`: the projection lives with the agent, in another file.
54
+ * import { useAgentState } from "@alexkroman1/aai-ui";
55
+ * import { cartSlot, cartView, type CartView } from "./shared.ts";
56
+ *
57
+ * const EMPTY: CartView = cartSlot.projection(cartView)(undefined);
58
+ *
59
+ * function Cart() {
60
+ * const cart = useAgentState<CartView>(EMPTY);
61
+ * return <ul>{cart.items.map((item) => <li key={item.sku}>{item.qty}</li>)}</ul>;
62
+ * }
63
+ * ```
64
+ *
65
+ * @param fallback - Returned while the agent has pushed nothing. Not memoized
66
+ * here — hoist it to module scope (or memoize it) so it is a stable
67
+ * reference across renders.
68
+ *
69
+ * @public
70
+ */
71
+ export declare function useAgentState<S = DefaultToolResult>(fallback: S): S;
42
72
  /**
43
73
  * Subscribe to custom events emitted by agent tools via
44
74
  * `ctx.send(event, data)`; the callback receives each event's `data`.
package/dist/hooks.js CHANGED
@@ -77,32 +77,10 @@ function useToolResult(...args) {
77
77
  else callback(tc.name, parsed, tc);
78
78
  });
79
79
  }
80
- /**
81
- * The agent's projected session state, or `null` before the first push.
82
- *
83
- * The counterpart to `syncState` on the agent: whatever that projection
84
- * returns is what arrives here — no per-tool result mirroring needed.
85
- *
86
- * ```tsx
87
- * import { useAgentState } from "@alexkroman1/aai-ui";
88
- *
89
- * type Item = { sku: string; qty: number };
90
- *
91
- * function Cart() {
92
- * const state = useAgentState<{ cart: Item[] }>();
93
- * return <ul>{state?.cart.map((item) => <li key={item.sku}>{item.qty}</li>)}</ul>;
94
- * }
95
- * ```
96
- *
97
- * Typed by the caller for the same reason `useToolResult` is: the shape is
98
- * the author's own projection, which the framework cannot see. It is
99
- * nullable on purpose — nothing has been pushed before the first tool call,
100
- * and a UI has to render that moment.
101
- *
102
- * @public
103
- */
104
- function useAgentState() {
105
- return useSessionSelector((snapshot) => snapshot.agentState);
80
+ function useAgentState(fallback) {
81
+ const state = useSessionSelector((snapshot) => snapshot.agentState);
82
+ if (state !== null) return state;
83
+ return fallback === void 0 ? null : fallback;
106
84
  }
107
85
  /**
108
86
  * Subscribe to custom events emitted by agent tools via
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export { buildAgentUrl, type ClientConfigResponse, fetchClientConfig, loadClientConfig, } from "./client-config.ts";
2
+ export { AutoScroll } from "./components/auto-scroll.tsx";
2
3
  export { Button, type ButtonSize, type ButtonVariant } from "./components/button.tsx";
3
4
  export { ChatView } from "./components/chat-view.tsx";
4
5
  export { Controls } from "./components/controls.tsx";
6
+ export { CheckboxField, Field, type FieldShell, FileField, type FileRead, type FileValue, Form, type FormProps, type FormValues, NumberField, SelectField, SubmitButton, TextAreaField, TextField, } from "./components/form.tsx";
5
7
  export { Markdown, type MarkdownVariant } from "./components/markdown.tsx";
6
8
  export { MessageList } from "./components/message-list.tsx";
7
9
  export { SidebarLayout } from "./components/sidebar-layout.tsx";
@@ -10,12 +12,21 @@ export { ToolCallRow, type ToolCallRowProps, type ToolCallRowVariant, } from "./
10
12
  export type { ToolDisplayConfig } from "./components/tool-config-context.ts";
11
13
  export { ToolConfigContext } from "./components/tool-config-context.ts";
12
14
  export { ApiUrlChip, SessionUrlChips, UiUrlChip } from "./components/url-chips.tsx";
15
+ export { WorkflowFields } from "./components/workflow-fields.tsx";
16
+ export { WorkflowProgress } from "./components/workflow-progress.tsx";
13
17
  export type { Session } from "./context.ts";
14
18
  export { SessionProvider, ThemeProvider, useSession, useSessionSelector, useTheme, } from "./context.ts";
15
19
  export type { BaseOptions, ClientConfig, ClientHandle, ComponentTier, ConfigTier, } from "./define-client.tsx";
16
20
  export { client } from "./define-client.tsx";
17
21
  export { useAgentState, useEvent, useToolCallStart, useToolResult } from "./hooks.ts";
22
+ export { type PageConfig, type PageHandle, page } from "./page.tsx";
18
23
  export { createSessionCore } from "./session-core.ts";
19
24
  export type { AgentCustomEvent, SessionCore, SessionCoreOptions, SessionSnapshot, } from "./session-core-types.ts";
20
25
  export type { AgentState, ChatMessage, ClientTheme, SessionError, SessionErrorCode, ToolCallInfo, VoiceSessionOptions, WebSocketConstructor, } from "./types.ts";
21
26
  export { VOICE_CAPTURE_CONSTRAINTS } from "./types.ts";
27
+ export { TRANSCRIBING_PLACEHOLDER, type UseUserTranscriptResult, useUserTranscript, } from "./use-user-transcript.ts";
28
+ export { type UseWorkflowSubmitOptions, type UseWorkflowsOptions, type UseWorkflowsResult, useWorkflowSubmit, useWorkflows, type WorkflowSubmission, } from "./use-workflow-form.ts";
29
+ export { DEFAULT_PROGRESS_POLL_MS, type UseWorkflowProgressResult, useWorkflowProgress, } from "./use-workflow-progress.ts";
30
+ export { DEFAULT_WORKFLOW_POLL_MS, MAX_MISSING_READS, type UseWorkflowRunResult, useWorkflowRun, } from "./use-workflow-run.ts";
31
+ export { type UseWorkflowRunsOptions, type UseWorkflowRunsResult, useWorkflowRuns, } from "./use-workflow-runs.ts";
32
+ export { createWorkflowApi, isTerminal, type WorkflowApi, type WorkflowApiOptions, type WorkflowOutputOf, type WorkflowRun, type WorkflowSummary, } from "./workflow-client.ts";