@runtypelabs/persona 3.31.1 → 3.33.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 (45) hide show
  1. package/README.md +2 -0
  2. package/dist/animations/glyph-cycle.d.cts +1 -1
  3. package/dist/animations/glyph-cycle.d.ts +1 -1
  4. package/dist/animations/{types-quh7NmYD.d.cts → types-CthJFfNx.d.cts} +7 -0
  5. package/dist/animations/{types-quh7NmYD.d.ts → types-CthJFfNx.d.ts} +7 -0
  6. package/dist/animations/wipe.d.cts +1 -1
  7. package/dist/animations/wipe.d.ts +1 -1
  8. package/dist/codegen.cjs +1 -1
  9. package/dist/codegen.js +1 -1
  10. package/dist/index.cjs +43 -43
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +288 -8
  13. package/dist/index.d.ts +288 -8
  14. package/dist/index.global.js +51 -51
  15. package/dist/index.global.js.map +1 -1
  16. package/dist/index.js +43 -43
  17. package/dist/index.js.map +1 -1
  18. package/dist/launcher.global.js.map +1 -1
  19. package/dist/smart-dom-reader.d.cts +78 -2
  20. package/dist/smart-dom-reader.d.ts +78 -2
  21. package/dist/theme-editor.cjs +30 -30
  22. package/dist/theme-editor.d.cts +92 -5
  23. package/dist/theme-editor.d.ts +92 -5
  24. package/dist/theme-editor.js +30 -30
  25. package/package.json +1 -1
  26. package/src/ask-user-question-tool.test.ts +148 -0
  27. package/src/ask-user-question-tool.ts +138 -0
  28. package/src/client.ts +43 -9
  29. package/src/components/messages.ts +10 -0
  30. package/src/components/suggestions.ts +49 -6
  31. package/src/index-core.ts +15 -0
  32. package/src/runtime/host-layout.test.ts +158 -3
  33. package/src/runtime/host-layout.ts +95 -1
  34. package/src/session.ts +188 -32
  35. package/src/session.webmcp.test.ts +48 -0
  36. package/src/suggest-replies-tool.test.ts +445 -0
  37. package/src/suggest-replies-tool.ts +152 -0
  38. package/src/theme-editor/index.ts +2 -0
  39. package/src/theme-editor/webmcp/index.ts +2 -0
  40. package/src/theme-editor/webmcp/types.ts +16 -3
  41. package/src/types.ts +79 -2
  42. package/src/ui.suggest-replies.test.ts +237 -0
  43. package/src/ui.ts +57 -13
  44. package/src/utils/dock.test.ts +23 -1
  45. package/src/utils/dock.ts +2 -0
package/README.md CHANGED
@@ -99,6 +99,8 @@ const docked = initAgentWidget({
99
99
 
100
100
  When `config.launcher.mountMode` is `'docked'`, `target` is treated as the page container that Persona should wrap. Use a concrete element such as `#workspace-main`; `body` and `html` are rejected.
101
101
 
102
+ **Height contract:** the docked shell sizes itself with `height: 100%`, so give it a definite height — usually `html, body { height: 100% }` or a fixed-height app-shell container around the target. If no ancestor provides one, the panel is clamped to `dock.maxHeight` (default `100dvh`; `resize`/`emerge` are also sticky-pinned — `push`/`overlay` get the cap only) so it stays viewport-sized and scrolls internally, and a console warning explains the fix. Override the cap with a CSS length or disable the guard with `dock.maxHeight: false`.
103
+
102
104
  With **`dock.reveal: 'resize'`** (default), a **closed** dock uses a **`0px`** column. **`'emerge'`** uses the same **column width** animation (content reflows) but the chat panel stays **`dock.width`** wide and is **clipped** by the growing slot—like a normal-width widget emerging from the edge. **`'overlay'`** overlays with `transform`. **`'push'`** uses a sliding track (Shopify-style). The built-in launcher stays hidden in docked mode—open with **`controller.open()`** (or your own chrome).
103
105
 
104
106
  **Rounded / card layout:** `initAgentWidget` inserts a flex **shell** as the **direct child** of your target’s **parent**, with your `target` in the content column and the dock beside it. Put border-radius, border, and `overflow: hidden` on that **parent** (or an ancestor that wraps only the shell) so the dock column sits inside the same visual card as your content.
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-quh7NmYD.cjs';
1
+ import { S as StreamAnimationPlugin } from './types-CthJFfNx.cjs';
2
2
 
3
3
  declare const glyphCycle: StreamAnimationPlugin;
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-quh7NmYD.js';
1
+ import { S as StreamAnimationPlugin } from './types-CthJFfNx.js';
2
2
 
3
3
  declare const glyphCycle: StreamAnimationPlugin;
4
4
 
@@ -659,6 +659,13 @@ type AgentMessageMetadata = {
659
659
  * paginated stepper. Persists alongside `askUserQuestionAnswers`.
660
660
  */
661
661
  askUserQuestionIndex?: number;
662
+ /**
663
+ * Set to `true` once a `suggest_replies` tool call's fire-and-forget
664
+ * `/resume` has been accepted by the server. Persisted belt-and-suspenders
665
+ * mirror of the in-memory resolved-key dedupe, so hydration/re-emit paths
666
+ * never re-resume the call.
667
+ */
668
+ suggestRepliesResolved?: boolean;
662
669
  };
663
670
  /**
664
671
  * Context passed to plugin lifecycle hooks. Carries the live DOM references
@@ -659,6 +659,13 @@ type AgentMessageMetadata = {
659
659
  * paginated stepper. Persists alongside `askUserQuestionAnswers`.
660
660
  */
661
661
  askUserQuestionIndex?: number;
662
+ /**
663
+ * Set to `true` once a `suggest_replies` tool call's fire-and-forget
664
+ * `/resume` has been accepted by the server. Persisted belt-and-suspenders
665
+ * mirror of the in-memory resolved-key dedupe, so hydration/re-emit paths
666
+ * never re-resume the call.
667
+ */
668
+ suggestRepliesResolved?: boolean;
662
669
  };
663
670
  /**
664
671
  * Context passed to plugin lifecycle hooks. Carries the live DOM references
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-quh7NmYD.cjs';
1
+ import { S as StreamAnimationPlugin } from './types-CthJFfNx.cjs';
2
2
 
3
3
  declare const wipe: StreamAnimationPlugin;
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-quh7NmYD.js';
1
+ import { S as StreamAnimationPlugin } from './types-CthJFfNx.js';
2
2
 
3
3
  declare const wipe: StreamAnimationPlugin;
4
4
 
package/dist/codegen.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var $=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var n in r)$(e,n,{get:r[n],enumerable:!0})},W=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of R(r))!v.call(e,o)&&o!==n&&$(e,o,{get:()=>r[o],enumerable:!(s=M(r,o))||s.enumerable});return e};var H=e=>W($({},"__esModule",{value:!0}),e);var B={};I(B,{generateCodeSnippet:()=>_});module.exports=H(B);var x="3.31.1";var c=x;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(r=>r.toString()).join(", ")}]`:e.toString()}function D(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var A=`({ text, message }: any) => {
1
+ "use strict";var $=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var n in r)$(e,n,{get:r[n],enumerable:!0})},W=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of R(r))!v.call(e,o)&&o!==n&&$(e,o,{get:()=>r[o],enumerable:!(s=M(r,o))||s.enumerable});return e};var H=e=>W($({},"__esModule",{value:!0}),e);var B={};I(B,{generateCodeSnippet:()=>_});module.exports=H(B);var x="3.33.0";var c=x;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(r=>r.toString()).join(", ")}]`:e.toString()}function D(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var A=`({ text, message }: any) => {
2
2
  const jsonSource = (message as any).rawContent || text || message.content;
3
3
  if (!jsonSource || typeof jsonSource !== 'string') return null;
4
4
  let cleanJson = jsonSource
package/dist/codegen.js CHANGED
@@ -1,4 +1,4 @@
1
- var S="3.31.1";var c=S;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(r=>r.toString()).join(", ")}]`:e.toString()}function T(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var x=`({ text, message }: any) => {
1
+ var S="3.33.0";var c=S;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(r=>r.toString()).join(", ")}]`:e.toString()}function T(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var x=`({ text, message }: any) => {
2
2
  const jsonSource = (message as any).rawContent || text || message.content;
3
3
  if (!jsonSource || typeof jsonSource !== 'string') return null;
4
4
  let cleanJson = jsonSource