@runtypelabs/persona 4.0.0 → 4.2.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/README.md +4 -4
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/index.cjs +52 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.global.js +41 -39
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +51 -49
- package/dist/index.js.map +1 -1
- package/dist/launcher.global.js +1 -1
- package/dist/launcher.global.js.map +1 -1
- package/dist/smart-dom-reader.d.cts +16 -1
- package/dist/smart-dom-reader.d.ts +16 -1
- package/dist/theme-editor-preview.cjs +45 -43
- package/dist/theme-editor-preview.d.cts +16 -1
- package/dist/theme-editor-preview.d.ts +16 -1
- package/dist/theme-editor-preview.js +45 -43
- package/dist/theme-editor.cjs +1 -1
- package/dist/theme-editor.d.cts +16 -1
- package/dist/theme-editor.d.ts +16 -1
- package/dist/theme-editor.js +1 -1
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.js +1 -1
- package/dist/widget.css +238 -0
- package/package.json +1 -1
- package/src/components/approval-actions.test.ts +309 -0
- package/src/components/approval-actions.ts +461 -0
- package/src/components/message-bubble.ts +7 -0
- package/src/styles/widget.css +238 -0
- package/src/theme-reference.ts +2 -2
- package/src/types.ts +16 -1
- package/src/ui.ts +25 -4
- package/src/utils/streaming-table.test.ts +100 -0
- package/src/utils/streaming-table.ts +103 -0
- package/src/utils/tokens.ts +15 -12
package/README.md
CHANGED
|
@@ -124,9 +124,9 @@ The full reference lives in [`docs/`](./docs/) and the theming guide:
|
|
|
124
124
|
- [Code Generator](./docs/CODE-GENERATOR.md): `@runtypelabs/persona/codegen` options for CLI/server-side snippet generation
|
|
125
125
|
- [THEME-CONFIG.md](./THEME-CONFIG.md): the complete theme and design-token reference
|
|
126
126
|
|
|
127
|
-
### Optional proxy server
|
|
127
|
+
### Optional Runtype proxy server
|
|
128
128
|
|
|
129
|
-
The proxy
|
|
129
|
+
The `@runtypelabs/persona-proxy` package handles flow configuration and forwards requests to Runtype. You can configure it in three ways:
|
|
130
130
|
|
|
131
131
|
**Option 1: Use default flow (recommended for getting started)**
|
|
132
132
|
|
|
@@ -200,9 +200,9 @@ Add `RUNTYPE_API_KEY` to your environment. The proxy constructs the Runtype payl
|
|
|
200
200
|
|
|
201
201
|
### Development notes
|
|
202
202
|
|
|
203
|
-
- The widget streams results using SSE and mirrors
|
|
203
|
+
- The widget streams results using SSE and mirrors Persona's unified flow/agent events (which Runtype implements natively), including `await` local-tool pauses and `/resume` continuations.
|
|
204
204
|
- Tailwind classes are prefixed with `tvw-` and scoped to `[data-persona-root]`, so they won't collide with the host page.
|
|
205
|
-
- Run `pnpm dev` from the repository root to boot the example proxy (`examples/vercel-edge`) and the vanilla demo (`
|
|
205
|
+
- Run `pnpm dev` from the repository root to boot the example Runtype proxy (`examples/vercel-edge`) and the vanilla demo (`apps/web`).
|
|
206
206
|
- The proxy prefers port `43111` but automatically selects the next free port if needed.
|
|
207
207
|
- `features.askUserQuestion.expose` and `features.suggestReplies.expose` advertise built-in LOCAL client tools through `clientTools[]`; leave `expose` off if the flow already declares those tools server-side.
|
|
208
208
|
- `webmcp: { enabled: true }` snapshots page-registered tools on `document.modelContext`, sends them as `clientTools[]`, executes returned `webmcp:*` calls in the browser, and resumes the paused execution.
|
package/dist/codegen.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var $=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=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 M(r))!R.call(e,o)&&o!==n&&$(e,o,{get:()=>r[o],enumerable:!(s=T(r,o))||s.enumerable});return e};var H=e=>W($({},"__esModule",{value:!0}),e);var B={};I(B,{generateCodeSnippet:()=>v});module.exports=H(B);var x="4.
|
|
1
|
+
"use strict";var $=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=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 M(r))!R.call(e,o)&&o!==n&&$(e,o,{get:()=>r[o],enumerable:!(s=T(r,o))||s.enumerable});return e};var H=e=>W($({},"__esModule",{value:!0}),e);var B={};I(B,{generateCodeSnippet:()=>v});module.exports=H(B);var x="4.2.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 k(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="4.
|
|
1
|
+
var S="4.2.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 _(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
|