@agentic-ui-experience/ui-runtime 0.0.1-beta.3 → 0.0.1-beta.4

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # @agentic-ui-experience/ui-runtime
2
2
 
3
- `@agentic-ui-experience/ui-runtime` is the runtime state layer for UI messages: it accepts the UI messages emitted by an agent, parses and validates components against the catalogs registered by the host, maintains subscribable UI state, and dispatches the actions the user triggers in the UI back to the host.
3
+ `@agentic-ui-experience/ui-runtime` is the runtime state layer for UI messages: it accepts the UI messages emitted by an agent, parses and validates components against the catalog configured by the host, maintains subscribable UI state, and dispatches the actions the user triggers in the UI back to the host.
4
4
 
5
- It does not build prompts and does not render components; React hosts usually use `@agentic-ui-experience/ui-react` directly.
5
+ Here **Runtime** means the frontend layer that consumes UI messages and maintains Surface state. It does not build prompts or render components; React Host apps usually use the Renderer binding in `@agentic-ui-experience/ui-react` directly. See the [project glossary](../../docs/glossary.md) for the related definitions.
6
6
 
7
7
  ```text
8
8
  Agent output
@@ -22,7 +22,7 @@ Create a runtime instance:
22
22
  import { createUIRuntime } from "@agentic-ui-experience/ui-runtime";
23
23
 
24
24
  const runtime = createUIRuntime({
25
- catalogs: [appCatalog],
25
+ catalog: appCatalog,
26
26
  onAction: (action) => {
27
27
  // Send the user action back to the agent or business logic.
28
28
  },
@@ -32,7 +32,7 @@ const runtime = createUIRuntime({
32
32
  });
33
33
  ```
34
34
 
35
- `catalogs` is required: the runtime uses it to recognize component names and to validate the props emitted by the agent against each component's own Zod schema. `normalizeMode` defaults to `"repair"`, which drops invalid components or messages and keeps as much valid content as possible; `"strict"` stops at the first error and exposes it through `onError` / `errors`.
35
+ `catalog` is required: the runtime uses it to recognize component names and to validate the props emitted by the agent against each component's own Zod schema. It is a single catalog, not a list — A2UI fixes a surface's catalog at `createSurface` time and never composes two catalogs into one component tree, so combine vocabularies with `defineCatalog({ extends })` instead. `normalizeMode` defaults to `"repair"`, which drops invalid components or messages and keeps as much valid content as possible; `"strict"` stops at the first error and exposes it through `onError` / `errors`.
36
36
 
37
37
  ### `ingest()`
38
38
 
@@ -44,6 +44,38 @@ runtime.ingest(modelOutput);
44
44
 
45
45
  `modelOutput` can be a full assistant text response, a `<a2ui-json>` envelope, a UI message array, or an object containing `uiMessages` / `messages`. The runtime calls `normalizeUIResponse()` internally, so the host usually does not need to parse first.
46
46
 
47
+ ### `ingestTransaction()`
48
+
49
+ Publish a prevalidated batch and synchronize host-owned state before subscribers
50
+ observe it:
51
+
52
+ ```ts
53
+ const accepted = runtime.ingestTransaction(messages, () => {
54
+ commitHostState();
55
+ });
56
+ ```
57
+
58
+ The runtime applies the batch to an isolated copy of the current processor,
59
+ calls the optional commit synchronously, and adopts the candidate processor only
60
+ after that callback returns. Code inside the callback may call `getState()` to
61
+ validate the candidate, while subscribers continue to see the prior state until
62
+ the atomic adoption and single notification. If the callback throws,
63
+ `ingestTransaction()` returns `false` without publishing the candidate, changing
64
+ assistant text or errors, notifying subscribers, or reporting the callback as a
65
+ runtime UI error. Runtime mutations other than `getState()` and other read APIs
66
+ are not allowed from inside the callback.
67
+
68
+ A successful transaction adopts a new processor snapshot. Subscribers should
69
+ read `getState()` after the notification instead of retaining a previous
70
+ `SurfaceModel` reference and expecting that object to be mutated in place.
71
+
72
+ It also returns `false` and does not call the commit when the runtime is
73
+ disposed, the batch contains no UI messages, or normalization/processing rejects
74
+ the candidate. A normalization or processing rejection may still be reported in
75
+ `errors`, but partially processed candidate messages never mutate live surfaces.
76
+ Use this for host-generated data bindings that must become visible atomically
77
+ with a surface replacement; keep `ingest()` for ordinary one-shot model output.
78
+
47
79
  ### `ingestStreaming()` / `endStream()`
48
80
 
49
81
  Process a streaming output:
@@ -133,7 +165,7 @@ The full loop is: the agent emits a button with an `action` in a UI message →
133
165
 
134
166
  ```ts
135
167
  const runtime = createUIRuntime({
136
- catalogs,
168
+ catalog,
137
169
  onAction: (action) => {
138
170
  action.name; // "submitForm"
139
171
  action.context; // { source: "signup" }
@@ -1 +1 @@
1
- (function(_0x2184d0,_0x3e3243){var _0x3ebbdc=_0x2b08,_0xe19aff=_0x2184d0();while(!![]){try{var _0x3ab040=parseInt(_0x3ebbdc(0x1bf))/0x1*(parseInt(_0x3ebbdc(0x1c1))/0x2)+-parseInt(_0x3ebbdc(0x1b6))/0x3*(-parseInt(_0x3ebbdc(0x1be))/0x4)+-parseInt(_0x3ebbdc(0x1b9))/0x5+-parseInt(_0x3ebbdc(0x1b8))/0x6*(-parseInt(_0x3ebbdc(0x1c0))/0x7)+parseInt(_0x3ebbdc(0x1b7))/0x8*(-parseInt(_0x3ebbdc(0x1ba))/0x9)+-parseInt(_0x3ebbdc(0x1bd))/0xa*(parseInt(_0x3ebbdc(0x1bc))/0xb)+parseInt(_0x3ebbdc(0x1bb))/0xc;if(_0x3ab040===_0x3e3243)break;else _0xe19aff['push'](_0xe19aff['shift']());}catch(_0x15b491){_0xe19aff['push'](_0xe19aff['shift']());}}}(_0x1722,0x56fab));export*from'@a2ui/web_core/v0_9/basic_catalog';function _0x2b08(_0x36071a,_0x2c5064){_0x36071a=_0x36071a-0x1b6;var _0x17220f=_0x1722();var _0x2b088a=_0x17220f[_0x36071a];return _0x2b088a;}function _0x1722(){var _0x4b2d05=['3IPHpCx','242382UbUvCT','282292xSlnVq','8583cFTWvg','126448qPHlkJ','54WInFHg','2861975lJBwLX','171ikyCQl','5395428FoaOTU','5995891LAFvqE','10RyHRQI','824QFIxdI'];_0x1722=function(){return _0x4b2d05;};return _0x1722();}
1
+ function _0x2dd0(_0x3a98af,_0xf232b1){_0x3a98af=_0x3a98af-0x7b;var _0x1e3cf6=_0x1e3c();var _0x2dd0da=_0x1e3cf6[_0x3a98af];return _0x2dd0da;}function _0x1e3c(){var _0xe61d6=['4626780cwPzSc','902450UQVatn','41279oYqngs','52190FHyEtu','5734476EBYRGR','885306cWXTPt','14NLdIFS','2111752MroboP','8BAahce'];_0x1e3c=function(){return _0xe61d6;};return _0x1e3c();}(function(_0x23c4bd,_0xba4d61){var _0x4c12f0=_0x2dd0,_0x811363=_0x23c4bd();while(!![]){try{var _0x29c863=parseInt(_0x4c12f0(0x7e))/0x1*(-parseInt(_0x4c12f0(0x81))/0x2)+parseInt(_0x4c12f0(0x80))/0x3+parseInt(_0x4c12f0(0x82))/0x4+-parseInt(_0x4c12f0(0x7c))/0x5+parseInt(_0x4c12f0(0x7b))/0x6+parseInt(_0x4c12f0(0x7d))/0x7*(parseInt(_0x4c12f0(0x83))/0x8)+-parseInt(_0x4c12f0(0x7f))/0x9;if(_0x29c863===_0xba4d61)break;else _0x811363['push'](_0x811363['shift']());}catch(_0x3d9253){_0x811363['push'](_0x811363['shift']());}}}(_0x1e3c,0x65d3b));export*from'@a2ui/web_core/v0_9/basic_catalog';
package/dist/catalog.js CHANGED
@@ -1 +1 @@
1
- (function(_0x339af3,_0x4bb9c8){const _0x5827d0=_0x4aa9,_0x52b48f=_0x339af3();while(!![]){try{const _0x1d2dd8=-parseInt(_0x5827d0(0xa7))/0x1+-parseInt(_0x5827d0(0xa8))/0x2*(-parseInt(_0x5827d0(0xa9))/0x3)+-parseInt(_0x5827d0(0x9f))/0x4+-parseInt(_0x5827d0(0xa5))/0x5*(parseInt(_0x5827d0(0xa0))/0x6)+parseInt(_0x5827d0(0xa3))/0x7*(parseInt(_0x5827d0(0xab))/0x8)+-parseInt(_0x5827d0(0xa2))/0x9*(-parseInt(_0x5827d0(0xa6))/0xa)+parseInt(_0x5827d0(0xac))/0xb;if(_0x1d2dd8===_0x4bb9c8)break;else _0x52b48f['push'](_0x52b48f['shift']());}catch(_0x2dbb99){_0x52b48f['push'](_0x52b48f['shift']());}}}(_0xe660,0xde021));import{Catalog}from'@a2ui/web_core/v0_9';import{BASIC_COMPONENTS,BASIC_FUNCTIONS}from'@a2ui/web_core/v0_9/basic_catalog';import{A2UI_BASIC_CATALOG_ID}from'@agentic-ui-experience/ui-core';function defineCatalog(_0x35e741){const _0x2a1bb8=_0x4aa9,_0x110616=_0x35e741['extends']??basicCatalog,_0x5629fa=_0x35e741['components']??[],_0x1d9db9=_0x35e741[_0x2a1bb8(0xa4)]??[];return new Catalog(_0x35e741['id'],[..._0x110616['components'][_0x2a1bb8(0xa1)](),..._0x5629fa],[..._0x110616[_0x2a1bb8(0xa4)][_0x2a1bb8(0xa1)](),..._0x1d9db9],_0x110616[_0x2a1bb8(0xaa)]);}const basicCatalog=new Catalog(A2UI_BASIC_CATALOG_ID,BASIC_COMPONENTS,BASIC_FUNCTIONS);function _0x4aa9(_0x43c7d8,_0x87d293){_0x43c7d8=_0x43c7d8-0x9f;const _0xe6605e=_0xe660();let _0x4aa97e=_0xe6605e[_0x43c7d8];return _0x4aa97e;}function _0xe660(){const _0x535908=['8AuJFgc','25034823bSmsJB','4467116oRKUph','8288310vbbHNJ','values','9xSQZUW','200459ZYFyKa','functions','5FccGDS','9323090bDDuoH','1337515bbcUiU','86182xoGsoD','105sJZLkj','themeSchema'];_0xe660=function(){return _0x535908;};return _0xe660();}export{basicCatalog,defineCatalog};
1
+ function _0x17ca(_0x411431,_0x200fa8){_0x411431=_0x411431-0xde;const _0x13b561=_0x13b5();let _0x17cacb=_0x13b561[_0x411431];return _0x17cacb;}(function(_0x3c830e,_0x23542c){const _0x3a438d=_0x17ca,_0x5d5a5b=_0x3c830e();while(!![]){try{const _0x27bd59=-parseInt(_0x3a438d(0xe4))/0x1+parseInt(_0x3a438d(0xe7))/0x2*(-parseInt(_0x3a438d(0xdf))/0x3)+-parseInt(_0x3a438d(0xe3))/0x4+-parseInt(_0x3a438d(0xe0))/0x5*(parseInt(_0x3a438d(0xea))/0x6)+parseInt(_0x3a438d(0xe1))/0x7+-parseInt(_0x3a438d(0xde))/0x8*(parseInt(_0x3a438d(0xe6))/0x9)+parseInt(_0x3a438d(0xe5))/0xa;if(_0x27bd59===_0x23542c)break;else _0x5d5a5b['push'](_0x5d5a5b['shift']());}catch(_0x8ef816){_0x5d5a5b['push'](_0x5d5a5b['shift']());}}}(_0x13b5,0x28507));import{Catalog}from'@a2ui/web_core/v0_9';function _0x13b5(){const _0x26a3a7=['49112xAESAR','6113730tBNSmU','90sGVxfF','62DGNmnb','values','functions','6OIGczR','components','51896PuQZjo','23739YsUmtK','1225220MMYhqQ','2009112miBFYp','extends','515732GsuXmt'];_0x13b5=function(){return _0x26a3a7;};return _0x13b5();}import{BASIC_COMPONENTS,BASIC_FUNCTIONS}from'@a2ui/web_core/v0_9/basic_catalog';import{A2UI_BASIC_CATALOG_ID}from'@agentic-ui-experience/ui-core';function defineCatalog(_0x46eccb){const _0x4374c1=_0x17ca,_0x370008=_0x46eccb[_0x4374c1(0xe2)]??basicCatalog,_0x4f1281=_0x46eccb[_0x4374c1(0xeb)]??[],_0x3ecbe2=_0x46eccb['functions']??[];return new Catalog(_0x46eccb['id'],[..._0x370008['components'][_0x4374c1(0xe8)](),..._0x4f1281],[..._0x370008[_0x4374c1(0xe9)]['values'](),..._0x3ecbe2],_0x370008['themeSchema']);}const basicCatalog=new Catalog(A2UI_BASIC_CATALOG_ID,BASIC_COMPONENTS,BASIC_FUNCTIONS);export{basicCatalog,defineCatalog};
@@ -1,3 +1,3 @@
1
1
  import type { Catalog, ComponentApi } from "@a2ui/web_core/v0_9";
2
2
  import type { ComponentValidator } from "@agentic-ui-experience/ui-core";
3
- export declare function createCatalogComponentValidator<TComp extends ComponentApi = ComponentApi>(catalogs: readonly Catalog<TComp>[]): ComponentValidator;
3
+ export declare function createCatalogComponentValidator<TComp extends ComponentApi = ComponentApi>(catalog: Catalog<TComp>): ComponentValidator;
@@ -1 +1 @@
1
- (function(_0x127a5d,_0x2a699e){const _0x2d5292=_0x1a09,_0x20f75e=_0x127a5d();while(!![]){try{const _0x3b82b2=parseInt(_0x2d5292(0x143))/0x1*(-parseInt(_0x2d5292(0x141))/0x2)+-parseInt(_0x2d5292(0x137))/0x3+parseInt(_0x2d5292(0x147))/0x4+parseInt(_0x2d5292(0x138))/0x5*(-parseInt(_0x2d5292(0x140))/0x6)+parseInt(_0x2d5292(0x13b))/0x7+-parseInt(_0x2d5292(0x144))/0x8*(-parseInt(_0x2d5292(0x139))/0x9)+-parseInt(_0x2d5292(0x13e))/0xa*(-parseInt(_0x2d5292(0x13a))/0xb);if(_0x3b82b2===_0x2a699e)break;else _0x20f75e['push'](_0x20f75e['shift']());}catch(_0xfedc24){_0x20f75e['push'](_0x20f75e['shift']());}}}(_0x885f,0x4fba0));function createCatalogComponentValidator(_0x266299){const _0x211e88=_0x1a09,_0x359b2d=new Map();for(const _0x2a84cc of _0x266299){for(const [_0x3b3311,_0x7dbdc3]of _0x2a84cc['components']){if(!_0x359b2d['has'](_0x3b3311))_0x359b2d[_0x211e88(0x13c)](_0x3b3311,_0x7dbdc3['schema']);}}return(_0x53d747,_0x1a09bf)=>{const _0x116570=_0x211e88,_0x1cac27=_0x359b2d['get'](_0x53d747);if(!_0x1cac27)return[_0x116570(0x13f)+_0x53d747+'\x22'];const _0xa3d404={..._0x1a09bf};delete _0xa3d404['id'],delete _0xa3d404['component'],delete _0xa3d404[_0x116570(0x142)],delete _0xa3d404['weight'];const _0xfe7d22=_0x1cac27['safeParse'](_0xa3d404);if(_0xfe7d22[_0x116570(0x146)])return[];return _0xfe7d22[_0x116570(0x145)]['issues'][_0x116570(0x13d)](_0x48ecb1=>{const _0x457743=_0x116570,_0x287757=_0x48ecb1['path'][_0x457743(0x148)]('.');return _0x287757?_0x287757+':\x20'+_0x48ecb1['message']:_0x48ecb1['message'];});};}function _0x1a09(_0x35505e,_0x2238bb){_0x35505e=_0x35505e-0x137;const _0x885f6b=_0x885f();let _0x1a0915=_0x885f6b[_0x35505e];return _0x1a0915;}export{createCatalogComponentValidator};function _0x885f(){const _0x2e011b=['15154980sUGGNT','unknown\x20component\x20\x22','105486UibIgf','32MPfiVE','accessibility','24964iDaLUv','1025208ONXaHn','error','success','89892TMaDgv','join','1851285xqkRXt','165VhFtJc','27OLajLK','11GtOGPr','5796UtyMKb','set','map'];_0x885f=function(){return _0x2e011b;};return _0x885f();}
1
+ function _0x382e(){const _0x21595b=['382435SnqBrv','2239400heUwkR','1423224rRaPLC','261yQsuiC','2302336mJxXfG','issues','1107460NSQMTF','2FjTLSf','54nimKLR','accessibility','success','unknown\x20component\x20\x22','32696wJpgxW','5520305oooyLf','components','path','message','safeParse'];_0x382e=function(){return _0x21595b;};return _0x382e();}(function(_0x9e75e3,_0x20b56d){const _0x5db89f=_0x5896,_0x3e2fa6=_0x9e75e3();while(!![]){try{const _0xe46225=-parseInt(_0x5db89f(0xa1))/0x1*(-parseInt(_0x5db89f(0xa6))/0x2)+-parseInt(_0x5db89f(0xae))/0x3+-parseInt(_0x5db89f(0xb0))/0x4+parseInt(_0x5db89f(0xac))/0x5*(-parseInt(_0x5db89f(0xa2))/0x6)+-parseInt(_0x5db89f(0xa7))/0x7+-parseInt(_0x5db89f(0xad))/0x8+parseInt(_0x5db89f(0xaf))/0x9*(parseInt(_0x5db89f(0xb2))/0xa);if(_0xe46225===_0x20b56d)break;else _0x3e2fa6['push'](_0x3e2fa6['shift']());}catch(_0x3d7cc4){_0x3e2fa6['push'](_0x3e2fa6['shift']());}}}(_0x382e,0x6aca7));function _0x5896(_0x26f685,_0x3c783e){_0x26f685=_0x26f685-0xa1;const _0x382ec8=_0x382e();let _0x58967c=_0x382ec8[_0x26f685];return _0x58967c;}function createCatalogComponentValidator(_0x2458c1){const _0x38c193=_0x5896,_0x195d90=new Map();for(const [_0x2d8e5d,_0x317e9f]of _0x2458c1[_0x38c193(0xa8)]){_0x195d90['set'](_0x2d8e5d,_0x317e9f['schema']);}return(_0x1ae736,_0x261b91)=>{const _0x31790e=_0x38c193,_0x49a10d=_0x195d90['get'](_0x1ae736);if(!_0x49a10d)return[_0x31790e(0xa5)+_0x1ae736+'\x22'];const _0x59637a={..._0x261b91};delete _0x59637a['id'],delete _0x59637a['component'],delete _0x59637a[_0x31790e(0xa3)],delete _0x59637a['weight'];const _0x5f5473=_0x49a10d[_0x31790e(0xab)](_0x59637a);if(_0x5f5473[_0x31790e(0xa4)])return[];return _0x5f5473['error'][_0x31790e(0xb1)]['map'](_0x32c652=>{const _0x9eaa11=_0x31790e,_0x5d603a=_0x32c652[_0x9eaa11(0xa9)]['join']('.');return _0x5d603a?_0x5d603a+':\x20'+_0x32c652['message']:_0x32c652[_0x9eaa11(0xaa)];});};}export{createCatalogComponentValidator};
package/dist/index.d.ts CHANGED
@@ -4,4 +4,4 @@ export { createCatalogComponentValidator } from "./component-validator.js";
4
4
  export { Catalog } from "@a2ui/web_core/v0_9";
5
5
  export type { ComponentApi, FunctionImplementation } from "@a2ui/web_core/v0_9";
6
6
  export { ActionSchema, CheckableSchema, CommonSchemas, DataBindingSchema, DynamicBooleanSchema, DynamicNumberSchema, DynamicStringListSchema, DynamicStringSchema, DynamicValueSchema, FunctionCallSchema } from "@a2ui/web_core/v0_9";
7
- export { z } from "zod";
7
+ export { z } from "zod/v3";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0x1172f4,_0x26ba62){var _0x5004e=_0x23e8,_0x13d284=_0x1172f4();while(!![]){try{var _0x5b208e=-parseInt(_0x5004e(0x1c5))/0x1+-parseInt(_0x5004e(0x1c4))/0x2+parseInt(_0x5004e(0x1c0))/0x3*(-parseInt(_0x5004e(0x1be))/0x4)+parseInt(_0x5004e(0x1c3))/0x5+parseInt(_0x5004e(0x1bf))/0x6*(parseInt(_0x5004e(0x1c1))/0x7)+-parseInt(_0x5004e(0x1c6))/0x8+parseInt(_0x5004e(0x1bd))/0x9*(parseInt(_0x5004e(0x1c2))/0xa);if(_0x5b208e===_0x26ba62)break;else _0x13d284['push'](_0x13d284['shift']());}catch(_0x1454be){_0x13d284['push'](_0x13d284['shift']());}}}(_0x2a03,0x75c45));import{basicCatalog,defineCatalog}from'./catalog.js';import{createUIRuntime}from'./runtime.js';import{createCatalogComponentValidator}from'./component-validator.js';function _0x23e8(_0x2c48a1,_0x2cf836){_0x2c48a1=_0x2c48a1-0x1bd;var _0x2a03c7=_0x2a03();var _0x23e8b0=_0x2a03c7[_0x2c48a1];return _0x23e8b0;}function _0x2a03(){var _0x67229f=['962223ezhOUe','409962drdidd','16342030XMBRuO','325495BVeIGj','626030JNWozU','491379QisYwm','3076992FtIZis','9bkNZFy','4aAizvy','30kbCxfG'];_0x2a03=function(){return _0x67229f;};return _0x2a03();}import{ActionSchema,Catalog,CheckableSchema,CommonSchemas,DataBindingSchema,DynamicBooleanSchema,DynamicNumberSchema,DynamicStringListSchema,DynamicStringSchema,DynamicValueSchema,FunctionCallSchema}from'@a2ui/web_core/v0_9';import{z}from'zod';export{ActionSchema,Catalog,CheckableSchema,CommonSchemas,DataBindingSchema,DynamicBooleanSchema,DynamicNumberSchema,DynamicStringListSchema,DynamicStringSchema,DynamicValueSchema,FunctionCallSchema,basicCatalog,createCatalogComponentValidator,createUIRuntime,defineCatalog,z};
1
+ (function(_0x1eeb5e,_0x2b0403){var _0x2cfefd=_0x3320,_0x95b23f=_0x1eeb5e();while(!![]){try{var _0x1a90e7=-parseInt(_0x2cfefd(0xe0))/0x1+parseInt(_0x2cfefd(0xe4))/0x2+parseInt(_0x2cfefd(0xdf))/0x3+parseInt(_0x2cfefd(0xe5))/0x4*(parseInt(_0x2cfefd(0xe7))/0x5)+-parseInt(_0x2cfefd(0xe2))/0x6+parseInt(_0x2cfefd(0xe1))/0x7+-parseInt(_0x2cfefd(0xe6))/0x8*(-parseInt(_0x2cfefd(0xe3))/0x9);if(_0x1a90e7===_0x2b0403)break;else _0x95b23f['push'](_0x95b23f['shift']());}catch(_0x3a3d6a){_0x95b23f['push'](_0x95b23f['shift']());}}}(_0x28ef,0xe7655));import{basicCatalog,defineCatalog}from'./catalog.js';import{createUIRuntime}from'./runtime.js';import{createCatalogComponentValidator}from'./component-validator.js';import{ActionSchema,Catalog,CheckableSchema,CommonSchemas,DataBindingSchema,DynamicBooleanSchema,DynamicNumberSchema,DynamicStringListSchema,DynamicStringSchema,DynamicValueSchema,FunctionCallSchema}from'@a2ui/web_core/v0_9';function _0x3320(_0xc037d6,_0x4bba7a){_0xc037d6=_0xc037d6-0xdf;var _0x28ef1f=_0x28ef();var _0x33206d=_0x28ef1f[_0xc037d6];return _0x33206d;}import{z}from'zod/v3';function _0x28ef(){var _0x3e36a1=['1949478VHXUfL','1793509adQWbb','6181147wsxrZR','6531702bBkjYO','225bPZwbG','312354fMrwDK','60988JuxEEm','236216ZFdfJf','460xjhzdv'];_0x28ef=function(){return _0x3e36a1;};return _0x28ef();}export{ActionSchema,Catalog,CheckableSchema,CommonSchemas,DataBindingSchema,DynamicBooleanSchema,DynamicNumberSchema,DynamicStringListSchema,DynamicStringSchema,DynamicValueSchema,FunctionCallSchema,basicCatalog,createCatalogComponentValidator,createUIRuntime,defineCatalog,z};
package/dist/runtime.d.ts CHANGED
@@ -10,7 +10,13 @@ export type UIRuntimeError = {
10
10
  message: string;
11
11
  };
12
12
  export interface UIRuntimeOptions<TComp extends ComponentApi = ComponentApi> {
13
- catalogs: UIRuntimeCatalog<TComp>[];
13
+ /**
14
+ * The single catalog this runtime renders. A2UI fixes a surface's catalog at
15
+ * `createSurface` time and never composes two catalogs into one component
16
+ * tree, so a runtime that renders more than one vocabulary has no way to
17
+ * express that; combine catalogs at definition time with `defineCatalog`.
18
+ */
19
+ catalog: UIRuntimeCatalog<TComp>;
14
20
  normalizeMode?: NormalizeUIResponseOptions["mode"];
15
21
  onAction?: (action: UIAction) => void;
16
22
  onError?: (error: UIRuntimeError) => void;
@@ -46,6 +52,12 @@ export interface UIRuntimeState<TComp extends ComponentApi = ComponentApi> {
46
52
  */
47
53
  export interface UIRuntime<TComp extends ComponentApi = ComponentApi> {
48
54
  ingest(payload: unknown): void;
55
+ /**
56
+ * Processes one prevalidated host transaction and invokes `commit` after all
57
+ * messages are accepted but before subscribers observe the new snapshot.
58
+ * Returns false without invoking `commit` when disposed, empty, or rejected.
59
+ */
60
+ ingestTransaction(payload: unknown, commit?: () => void): boolean;
49
61
  ingestStreaming(accumulatedText: string): void;
50
62
  endStream(): void;
51
63
  reset(): void;
package/dist/runtime.js CHANGED
@@ -1 +1 @@
1
- (function(_0x171439,_0x507862){const _0x3fc1bc=_0x4e33,_0x2d0488=_0x171439();while(!![]){try{const _0x347407=-parseInt(_0x3fc1bc(0x1db))/0x1*(parseInt(_0x3fc1bc(0x1d4))/0x2)+-parseInt(_0x3fc1bc(0x1ef))/0x3*(parseInt(_0x3fc1bc(0x1cf))/0x4)+-parseInt(_0x3fc1bc(0x1cd))/0x5+-parseInt(_0x3fc1bc(0x1e3))/0x6+-parseInt(_0x3fc1bc(0x1d8))/0x7*(-parseInt(_0x3fc1bc(0x1de))/0x8)+-parseInt(_0x3fc1bc(0x1f0))/0x9*(parseInt(_0x3fc1bc(0x1ca))/0xa)+parseInt(_0x3fc1bc(0x1ce))/0xb*(parseInt(_0x3fc1bc(0x1d6))/0xc);if(_0x347407===_0x507862)break;else _0x2d0488['push'](_0x2d0488['shift']());}catch(_0x679375){_0x2d0488['push'](_0x2d0488['shift']());}}}(_0x5e7b,0x5a8fa));import{MessageProcessor}from'@a2ui/web_core/v0_9';import{splitUIEnvelope,normalizeUIResponse,toSDKCompatibleA2UIMessage}from'@agentic-ui-experience/ui-core';import{createCatalogComponentValidator}from'./component-validator.js';function scanNextTopLevelObject(_0x1a918b,_0x52adf6){const _0x5baaf5=_0x4e33;let _0x1877e7=_0x52adf6;while(_0x1877e7<_0x1a918b['length']&&/\s/['test'](_0x1a918b[_0x1877e7]))_0x1877e7++;while(_0x1877e7<_0x1a918b['length']&&(_0x1a918b[_0x1877e7]==='['||_0x1a918b[_0x1877e7]===',')){_0x1877e7++;while(_0x1877e7<_0x1a918b[_0x5baaf5(0x1e8)]&&/\s/[_0x5baaf5(0x1d3)](_0x1a918b[_0x1877e7]))_0x1877e7++;}if(_0x1877e7>=_0x1a918b[_0x5baaf5(0x1e8)]||_0x1a918b[_0x1877e7]!=='{')return null;let _0x44413b=0x0,_0x1d6203=![],_0x2c54de=![];const _0x4ba976=_0x1877e7;for(;_0x1877e7<_0x1a918b[_0x5baaf5(0x1e8)];_0x1877e7++){const _0x49c0e7=_0x1a918b[_0x1877e7];if(_0x1d6203){if(_0x2c54de){_0x2c54de=![];continue;}if(_0x49c0e7==='\x5c'){_0x2c54de=!![];continue;}_0x49c0e7==='\x22'&&(_0x1d6203=![]);continue;}if(_0x49c0e7==='\x22'){_0x1d6203=!![];continue;}if(_0x49c0e7==='{')_0x44413b++;else{if(_0x49c0e7==='}'){_0x44413b--;if(_0x44413b===0x0)return{'obj':_0x1a918b['slice'](_0x4ba976,_0x1877e7+0x1),'nextIdx':_0x1877e7+0x1};}}}return null;}function createUIRuntime(_0x5020f4){const _0x510cfa=_0x4e33,_0x15c68b=_0x5020f4[_0x510cfa(0x1d1)],_0x354eb0=_0x5020f4['normalizeMode']??_0x510cfa(0x1dd),_0x3a0211=createCatalogComponentValidator(_0x15c68b),_0x43a8f2=new Set();let _0x31f1cb;const _0x3215a7=[],_0xfa114e=new Map();let _0x5c5a5c=![],_0x23ef59='',_0x1fe684=0x0,_0x295bbe=0x0,_0x2ce03e=![];const _0x56e3c5=()=>{_0x23ef59='',_0x1fe684=0x0,_0x295bbe=0x0,_0x2ce03e=![];},_0xcddd4e=new MessageProcessor(_0x15c68b,_0x29c29a=>{const _0x34c426=_0x510cfa;_0x5020f4[_0x34c426(0x1ed)]?.(_0x29c29a);});let _0x5a40dd=null;const _0x1d9d2d=()=>{_0x5a40dd=null;for(const _0x3ca26c of _0x43a8f2)_0x3ca26c();},_0x3611a7=_0x3fc08e=>{const _0x488581=_0x510cfa;_0x3215a7[_0x488581(0x1e0)](_0x3fc08e),_0x5020f4['onError']?.(_0x3fc08e);},_0xb38d62=_0xcddd4e[_0x510cfa(0x1eb)](_0x4470e9=>{const _0x4c5d6e=_0x510cfa,_0x1e563a=_0x4470e9['onError'][_0x4c5d6e(0x1cb)](_0x50796a=>{const _0x35b85e=_0x4c5d6e,_0x44c044=_0x50796a??{};_0x3611a7({'surfaceId':_0x4470e9['id'],..._0x44c044['code']!==void 0x0?{'code':_0x44c044['code']}:{},'message':_0x44c044[_0x35b85e(0x1e1)]??'A2UI\x20surface\x20error'}),_0x1d9d2d();});_0xfa114e['set'](_0x4470e9['id'],_0x1e563a),_0x1d9d2d();}),_0xa99061=_0xcddd4e['onSurfaceDeleted'](_0x588136=>{const _0x41d93a=_0x510cfa;_0xfa114e[_0x41d93a(0x1df)](_0x588136)?.[_0x41d93a(0x1e5)](),_0xfa114e[_0x41d93a(0x1e9)](_0x588136),_0x1d9d2d();}),_0x4da7f3=()=>{const _0x1380ee=_0x510cfa;if(_0x5a40dd!==null)return _0x5a40dd;const _0xfb9c4e=Array['from'](_0xcddd4e[_0x1380ee(0x1e6)][_0x1380ee(0x1c9)]['values']());return _0x5a40dd=_0x31f1cb===void 0x0?{'surfaces':_0xfb9c4e,'errors':[..._0x3215a7]}:{'surfaces':_0xfb9c4e,'assistantText':_0x31f1cb,'errors':[..._0x3215a7]},_0x5a40dd;},_0x527e9d=_0x532923=>{const _0x1460e0=_0x510cfa;if(_0x5c5a5c)return;let _0x10d9a0=![];try{const _0x393532=normalizeUIResponse(_0x532923,{'mode':_0x354eb0,'validateComponent':_0x3a0211});_0x393532['assistantText']!==void 0x0&&(_0x31f1cb=_0x393532['assistantText'],_0x10d9a0=!![]);if(_0x393532[_0x1460e0(0x1d2)][_0x1460e0(0x1e8)]>0x0){const _0x24f297=_0x393532['uiMessages']['map'](toSDKCompatibleA2UIMessage);_0xcddd4e['processMessages'](_0x24f297),_0x10d9a0=!![];}}catch(_0x5d7a8c){_0x3611a7({'message':_0x5d7a8c instanceof Error?_0x5d7a8c['message']:String(_0x5d7a8c)}),_0x10d9a0=!![];}if(_0x10d9a0)_0x1d9d2d();},_0x2adf34=_0x1edc70=>{const _0x4d2c1c=_0x510cfa;if(_0x5c5a5c)return;!_0x1edc70['startsWith'](_0x23ef59)&&_0x56e3c5();let _0x4b97cd=![];const _0x51cfed=splitUIEnvelope(_0x1edc70);_0x31f1cb!==_0x51cfed[_0x4d2c1c(0x1d9)]&&(_0x31f1cb=_0x51cfed[_0x4d2c1c(0x1d9)],_0x4b97cd=!![]);if(_0x51cfed[_0x4d2c1c(0x1cc)]!==null&&!_0x2ce03e)while(!![]){const _0x264e09=scanNextTopLevelObject(_0x51cfed['a2uiInner'],_0x1fe684);if(!_0x264e09)break;try{const _0x37e985=JSON[_0x4d2c1c(0x1e2)](_0x264e09[_0x4d2c1c(0x1e7)]),_0x2ecd31=normalizeUIResponse([_0x37e985],{'mode':_0x354eb0,'validateComponent':_0x3a0211});if(_0x2ecd31['uiMessages'][_0x4d2c1c(0x1e8)]>0x0){const _0x398fce=_0x2ecd31['uiMessages'][_0x4d2c1c(0x1c8)](toSDKCompatibleA2UIMessage);_0xcddd4e[_0x4d2c1c(0x1ea)](_0x398fce),_0x295bbe+=_0x2ecd31[_0x4d2c1c(0x1d2)]['length'],_0x4b97cd=!![];}}catch{_0x2ce03e=!![];break;}_0x1fe684=_0x264e09['nextIdx'];}_0x23ef59=_0x1edc70;if(_0x4b97cd)_0x1d9d2d();},_0x7c2af5=()=>{const _0x338768=_0x510cfa;if(_0x5c5a5c)return;const _0x5a57ee=_0x23ef59;if(_0x5a57ee['length']===0x0&&!_0x2ce03e)return;const _0x1215d1=splitUIEnvelope(_0x5a57ee);let _0x545776=![];_0x31f1cb!==_0x1215d1['visibleText']&&(_0x31f1cb=_0x1215d1['visibleText'],_0x545776=!![]);const _0x4ecbc2=_0x2ce03e||!_0x1215d1[_0x338768(0x1da)];if(_0x4ecbc2&&_0x5a57ee[_0x338768(0x1e8)]>0x0)try{const _0x3d56a5=normalizeUIResponse(_0x5a57ee,{'mode':_0x354eb0,'validateComponent':_0x3a0211}),_0x48b082=_0x3d56a5['uiMessages'][_0x338768(0x1ec)](_0x295bbe);if(_0x48b082['length']>0x0){const _0x1958c6=_0x48b082['map'](toSDKCompatibleA2UIMessage);_0xcddd4e[_0x338768(0x1ea)](_0x1958c6),_0x295bbe+=_0x48b082[_0x338768(0x1e8)],_0x545776=!![];}}catch(_0x32661d){_0x3611a7({'message':_0x32661d instanceof Error?_0x32661d['message']:String(_0x32661d)}),_0x545776=!![];}_0x56e3c5();if(_0x545776)_0x1d9d2d();},_0x58940a=()=>{const _0x2cbdb6=_0x510cfa;if(_0x5c5a5c)return;const _0x14bae1=Array['from'](_0xcddd4e[_0x2cbdb6(0x1e6)]['surfacesMap']['keys']());for(const _0x2efe96 of _0x14bae1){_0xcddd4e['model'][_0x2cbdb6(0x1ee)](_0x2efe96);}_0x31f1cb=void 0x0,_0x3215a7['length']=0x0,_0x56e3c5(),_0x1d9d2d();},_0x143dd7=()=>{const _0x172a6c=_0x510cfa;if(_0x5c5a5c)return;_0x5c5a5c=!![],_0xb38d62[_0x172a6c(0x1e5)](),_0xa99061['unsubscribe']();for(const _0x2d2f62 of _0xfa114e[_0x172a6c(0x1e4)]())_0x2d2f62['unsubscribe']();_0xfa114e['clear'](),_0xcddd4e[_0x172a6c(0x1e6)][_0x172a6c(0x1d0)](),_0x43a8f2['clear']();},_0x3b7368=_0x5b0a85=>{const _0x110400=_0x510cfa;if(_0x5c5a5c)return()=>{};return _0x43a8f2[_0x110400(0x1d7)](_0x5b0a85),()=>{_0x43a8f2['delete'](_0x5b0a85);};},_0x391f99=()=>{const _0x48ddc5=_0x510cfa;if(_0x5c5a5c)return;if(_0x3215a7['length']===0x0)return;_0x3215a7[_0x48ddc5(0x1e8)]=0x0,_0x1d9d2d();};return{'ingest':_0x527e9d,'ingestStreaming':_0x2adf34,'endStream':_0x7c2af5,'reset':_0x58940a,'clearErrors':_0x391f99,'dispose':_0x143dd7,'getState':_0x4da7f3,'subscribe':_0x3b7368,'getClientCapabilities':_0x3178c1=>_0xcddd4e[_0x510cfa(0x1dc)](_0x3178c1),'getClientDataModel':()=>_0xcddd4e[_0x510cfa(0x1d5)]()};}function _0x4e33(_0x3c82d9,_0x28b4b5){_0x3c82d9=_0x3c82d9-0x1c8;const _0x5e7be1=_0x5e7b();let _0x4e3311=_0x5e7be1[_0x3c82d9];return _0x4e3311;}function _0x5e7b(){const _0x16172f=['repair','4072BnjoUI','get','push','message','parse','3472758SOeydy','values','unsubscribe','model','obj','length','delete','processMessages','onSurfaceCreated','slice','onAction','deleteSurface','279NQwfqh','234UsOHCJ','map','surfacesMap','86120YhYBVf','subscribe','a2uiInner','2650355GGLgnf','2354KjKatM','2916mAmzkA','dispose','catalogs','uiMessages','test','17134IHpUSD','getClientDataModel','114624RQslKP','add','21TvSUsS','visibleText','closed','32KdsRug','getClientCapabilities'];_0x5e7b=function(){return _0x16172f;};return _0x5e7b();}export{createUIRuntime};
1
+ function _0x5bbe(){const _0x343fd8=['obj','318992rhXLmA','UI\x20runtime\x20mutations\x20are\x20not\x20allowed\x20inside\x20a\x20transaction\x20commit\x20callback.','clear','visibleText','deleteSurface','code','dispose','onSurfaceDeleted','processMessages','onSurfaceCreated','22PTxkHP','130PFSLvc','dataModel','add','length','assistantText','3205404Ejjyvi','delete','nextIdx','getClientDataModel','catalog','a2uiInner','model','properties','133OzEXAF','values','surfacesMap','entries','slice','72244IzhKaJ','test','13107186NWODIE','773795RxocQr','subscribe','165CetYDA','message','3010630KGyFrU','keys','startsWith','uiMessages','componentsModel','repair','v0.9','unsubscribe','19583FHgXcg','54KlOZoc','map'];_0x5bbe=function(){return _0x343fd8;};return _0x5bbe();}(function(_0x59d65f,_0x58b0b8){const _0x195f5b=_0x2056,_0x12538b=_0x59d65f();while(!![]){try{const _0xe773c2=parseInt(_0x195f5b(0x1f7))/0x1*(parseInt(_0x195f5b(0x206))/0x2)+-parseInt(_0x195f5b(0x1ed))/0x3*(-parseInt(_0x195f5b(0x1e8))/0x4)+parseInt(_0x195f5b(0x1eb))/0x5*(-parseInt(_0x195f5b(0x1f8))/0x6)+-parseInt(_0x195f5b(0x1e3))/0x7*(parseInt(_0x195f5b(0x1fb))/0x8)+parseInt(_0x195f5b(0x1ea))/0x9+-parseInt(_0x195f5b(0x1ef))/0xa+-parseInt(_0x195f5b(0x205))/0xb*(parseInt(_0x195f5b(0x20b))/0xc);if(_0xe773c2===_0x58b0b8)break;else _0x12538b['push'](_0x12538b['shift']());}catch(_0x543ac8){_0x12538b['push'](_0x12538b['shift']());}}}(_0x5bbe,0xb3e66));import{MessageProcessor}from'@a2ui/web_core/v0_9';function _0x2056(_0x52677d,_0x537eb7){_0x52677d=_0x52677d-0x1e1;const _0x5bbee6=_0x5bbe();let _0x20563b=_0x5bbee6[_0x52677d];return _0x20563b;}import{splitUIEnvelope,normalizeUIResponse,toSDKCompatibleA2UIMessage}from'@agentic-ui-experience/ui-core';import{createCatalogComponentValidator}from'./component-validator.js';function scanNextTopLevelObject(_0x35d3c3,_0x1bba4c){const _0x5d1f95=_0x2056;let _0x40e0f0=_0x1bba4c;while(_0x40e0f0<_0x35d3c3[_0x5d1f95(0x209)]&&/\s/[_0x5d1f95(0x1e9)](_0x35d3c3[_0x40e0f0]))_0x40e0f0++;while(_0x40e0f0<_0x35d3c3[_0x5d1f95(0x209)]&&(_0x35d3c3[_0x40e0f0]==='['||_0x35d3c3[_0x40e0f0]===',')){_0x40e0f0++;while(_0x40e0f0<_0x35d3c3[_0x5d1f95(0x209)]&&/\s/['test'](_0x35d3c3[_0x40e0f0]))_0x40e0f0++;}if(_0x40e0f0>=_0x35d3c3['length']||_0x35d3c3[_0x40e0f0]!=='{')return null;let _0x2c1884=0x0,_0x57c15f=![],_0x1d312e=![];const _0x40e35d=_0x40e0f0;for(;_0x40e0f0<_0x35d3c3['length'];_0x40e0f0++){const _0x188afb=_0x35d3c3[_0x40e0f0];if(_0x57c15f){if(_0x1d312e){_0x1d312e=![];continue;}if(_0x188afb==='\x5c'){_0x1d312e=!![];continue;}_0x188afb==='\x22'&&(_0x57c15f=![]);continue;}if(_0x188afb==='\x22'){_0x57c15f=!![];continue;}if(_0x188afb==='{')_0x2c1884++;else{if(_0x188afb==='}'){_0x2c1884--;if(_0x2c1884===0x0)return{'obj':_0x35d3c3['slice'](_0x40e35d,_0x40e0f0+0x1),'nextIdx':_0x40e0f0+0x1};}}}return null;}function createUIRuntime(_0xa1c68d){const _0x32243d=_0x2056,_0x47faae=_0xa1c68d['catalog'],_0x5d129d=_0xa1c68d['normalizeMode']??_0x32243d(0x1f4),_0x513541=createCatalogComponentValidator(_0x47faae),_0x304d02=new Set();let _0x1a743f;const _0x53a4f2=[],_0x4da545=new Map();let _0xcc6a92=![],_0x3b74f2='',_0x1bed05=0x0,_0x53903d=0x0,_0x335b37=![];const _0x545125=()=>{_0x3b74f2='',_0x1bed05=0x0,_0x53903d=0x0,_0x335b37=![];},_0x20ba3e=()=>new MessageProcessor([_0x47faae],_0x30a554=>{_0xa1c68d['onAction']?.(_0x30a554);});let _0xe27946=_0x20ba3e(),_0x4ef4c6=null,_0x4596ec=![];const _0xd19272=()=>{_0x4ef4c6=null;for(const _0x11612c of _0x304d02)_0x11612c();},_0x452095=_0xd9ce90=>{_0x53a4f2['push'](_0xd9ce90),_0xa1c68d['onError']?.(_0xd9ce90);},_0x380a5e=_0x39f84d=>{const _0x5cf8be=_0x32243d;_0x4da545['get'](_0x39f84d['id'])?.['unsubscribe']();const _0x2509c2=_0x39f84d['onError'][_0x5cf8be(0x1ec)](_0x486c1b=>{const _0x668c89=_0x5cf8be,_0x329816=_0x486c1b??{};_0x452095({'surfaceId':_0x39f84d['id'],..._0x329816[_0x668c89(0x200)]!==void 0x0?{'code':_0x329816['code']}:{},'message':_0x329816[_0x668c89(0x1ee)]??'A2UI\x20surface\x20error'}),_0xd19272();});_0x4da545['set'](_0x39f84d['id'],_0x2509c2);};let _0x118b1f,_0xc1cb3a;const _0x3a6547=_0x3aa493=>{const _0x34fbf8=_0x32243d;_0x118b1f=_0x3aa493[_0x34fbf8(0x204)](_0x383757=>{_0x380a5e(_0x383757),_0xd19272();}),_0xc1cb3a=_0x3aa493[_0x34fbf8(0x202)](_0x103df3=>{_0x4da545['get'](_0x103df3)?.['unsubscribe'](),_0x4da545['delete'](_0x103df3),_0xd19272();});for(const _0x417914 of _0x3aa493[_0x34fbf8(0x1e1)][_0x34fbf8(0x1e5)][_0x34fbf8(0x1e4)]()){_0x380a5e(_0x417914);}},_0x2228b8=()=>{const _0x4e04d1=_0x32243d;_0x118b1f['unsubscribe'](),_0xc1cb3a[_0x4e04d1(0x1f6)]();for(const _0x1a0ca8 of _0x4da545[_0x4e04d1(0x1e4)]())_0x1a0ca8[_0x4e04d1(0x1f6)]();_0x4da545[_0x4e04d1(0x1fd)]();};_0x3a6547(_0xe27946);const _0x3abf6a=_0x400331=>Array['from'](_0x400331['model']['surfacesMap'][_0x32243d(0x1e4)]())['flatMap'](_0x3a51d5=>{const _0x3b43cb=_0x32243d,_0x2f5c97=[..._0x3a51d5[_0x3b43cb(0x1f3)][_0x3b43cb(0x1e6)]][_0x3b43cb(0x1f9)](([_0x60e003,_0x5e8175])=>({'id':_0x60e003,'component':_0x5e8175['type'],...structuredClone(_0x5e8175[_0x3b43cb(0x1e2)])})),_0xe847a9=_0x3a51d5[_0x3b43cb(0x207)]['get']('/');return[{'version':'v0.9','createSurface':{'surfaceId':_0x3a51d5['id'],'catalogId':_0x3a51d5[_0x3b43cb(0x20f)]['id'],'theme':structuredClone(_0x3a51d5['theme']),'sendDataModel':_0x3a51d5['sendDataModel']}},..._0x2f5c97[_0x3b43cb(0x209)]>0x0?[{'version':_0x3b43cb(0x1f5),'updateComponents':{'surfaceId':_0x3a51d5['id'],'components':_0x2f5c97}}]:[],..._0xe847a9===void 0x0?[]:[{'version':_0x3b43cb(0x1f5),'updateDataModel':{'surfaceId':_0x3a51d5['id'],'path':'/','value':structuredClone(_0xe847a9)}}]];}),_0x46bfe8=()=>{const _0x40369=_0x32243d;if(_0x4596ec)throw new Error(_0x40369(0x1fc));},_0x246a5c=()=>{const _0x1f64ef=_0x32243d;if(_0x4ef4c6!==null)return _0x4ef4c6;const _0x2d8680=Array['from'](_0xe27946['model'][_0x1f64ef(0x1e5)]['values']());return _0x4ef4c6=_0x1a743f===void 0x0?{'surfaces':_0x2d8680,'errors':[..._0x53a4f2]}:{'surfaces':_0x2d8680,'assistantText':_0x1a743f,'errors':[..._0x53a4f2]},_0x4ef4c6;},_0x586a5e=_0x30ecf5=>{const _0x43ed99=_0x32243d;if(_0xcc6a92)return;_0x46bfe8();let _0x14ef2a=![];try{const _0x5a5eb3=normalizeUIResponse(_0x30ecf5,{'mode':_0x5d129d,'validateComponent':_0x513541});_0x5a5eb3['assistantText']!==void 0x0&&(_0x1a743f=_0x5a5eb3[_0x43ed99(0x20a)],_0x14ef2a=!![]);if(_0x5a5eb3['uiMessages'][_0x43ed99(0x209)]>0x0){const _0x2d2187=_0x5a5eb3['uiMessages'][_0x43ed99(0x1f9)](toSDKCompatibleA2UIMessage);_0xe27946['processMessages'](_0x2d2187),_0x14ef2a=!![];}}catch(_0x1f6790){_0x452095({'message':_0x1f6790 instanceof Error?_0x1f6790[_0x43ed99(0x1ee)]:String(_0x1f6790)}),_0x14ef2a=!![];}if(_0x14ef2a)_0xd19272();},_0x468458=(_0x3c2447,_0x3fc7d5)=>{const _0x263039=_0x32243d;if(_0xcc6a92)return![];_0x46bfe8();let _0x5313a6;try{_0x5313a6=normalizeUIResponse(_0x3c2447,{'mode':_0x5d129d,'validateComponent':_0x513541});}catch(_0x37e76e){return _0x452095({'message':_0x37e76e instanceof Error?_0x37e76e[_0x263039(0x1ee)]:String(_0x37e76e)}),_0xd19272(),![];}if(_0x5313a6['uiMessages']['length']===0x0)return![];const _0x7dda=_0xe27946,_0x36a19b=_0x1a743f,_0x4c3e60=_0x4ef4c6,_0x9e0723=_0x20ba3e();try{const _0x5e3e39=_0x3abf6a(_0x7dda);_0x5e3e39[_0x263039(0x209)]>0x0&&_0x9e0723[_0x263039(0x203)](_0x5e3e39);const _0xbc4b04=_0x5313a6[_0x263039(0x1f2)][_0x263039(0x1f9)](toSDKCompatibleA2UIMessage);_0x9e0723[_0x263039(0x203)](_0xbc4b04);}catch(_0x25f6cb){return _0x9e0723[_0x263039(0x1e1)][_0x263039(0x201)](),_0x452095({'message':_0x25f6cb instanceof Error?_0x25f6cb[_0x263039(0x1ee)]:String(_0x25f6cb)}),_0xd19272(),![];}_0xe27946=_0x9e0723;_0x5313a6[_0x263039(0x20a)]!==void 0x0&&(_0x1a743f=_0x5313a6[_0x263039(0x20a)]);_0x4ef4c6=null,_0x4596ec=!![];try{_0x3fc7d5?.();}catch(_0x1b27f6){return _0xe27946=_0x7dda,_0x1a743f=_0x36a19b,_0x4ef4c6=_0x4c3e60,_0x9e0723[_0x263039(0x1e1)]['dispose'](),![];}finally{_0x4596ec=![];}return _0x2228b8(),_0x3a6547(_0x9e0723),_0x7dda[_0x263039(0x1e1)][_0x263039(0x201)](),_0x4ef4c6=null,_0xd19272(),!![];},_0xe8c9d2=_0x539df1=>{const _0x23cdfd=_0x32243d;if(_0xcc6a92)return;_0x46bfe8();!_0x539df1[_0x23cdfd(0x1f1)](_0x3b74f2)&&_0x545125();let _0x5327fb=![];const _0x4409e2=splitUIEnvelope(_0x539df1);_0x1a743f!==_0x4409e2[_0x23cdfd(0x1fe)]&&(_0x1a743f=_0x4409e2[_0x23cdfd(0x1fe)],_0x5327fb=!![]);if(_0x4409e2[_0x23cdfd(0x210)]!==null&&!_0x335b37)while(!![]){const _0x519468=scanNextTopLevelObject(_0x4409e2[_0x23cdfd(0x210)],_0x1bed05);if(!_0x519468)break;try{const _0xb9a886=JSON['parse'](_0x519468[_0x23cdfd(0x1fa)]),_0x30a654=normalizeUIResponse([_0xb9a886],{'mode':_0x5d129d,'validateComponent':_0x513541});if(_0x30a654[_0x23cdfd(0x1f2)][_0x23cdfd(0x209)]>0x0){const _0x5e3de9=_0x30a654[_0x23cdfd(0x1f2)]['map'](toSDKCompatibleA2UIMessage);_0xe27946['processMessages'](_0x5e3de9),_0x53903d+=_0x30a654[_0x23cdfd(0x1f2)][_0x23cdfd(0x209)],_0x5327fb=!![];}}catch{_0x335b37=!![];break;}_0x1bed05=_0x519468[_0x23cdfd(0x20d)];}_0x3b74f2=_0x539df1;if(_0x5327fb)_0xd19272();},_0x5502e4=()=>{const _0xce97a6=_0x32243d;if(_0xcc6a92)return;_0x46bfe8();const _0x1a1c70=_0x3b74f2;if(_0x1a1c70[_0xce97a6(0x209)]===0x0&&!_0x335b37)return;const _0x4679cb=splitUIEnvelope(_0x1a1c70);let _0x1b9a82=![];_0x1a743f!==_0x4679cb[_0xce97a6(0x1fe)]&&(_0x1a743f=_0x4679cb[_0xce97a6(0x1fe)],_0x1b9a82=!![]);const _0x298023=_0x335b37||!_0x4679cb['closed'];if(_0x298023&&_0x1a1c70[_0xce97a6(0x209)]>0x0)try{const _0x1510dc=normalizeUIResponse(_0x1a1c70,{'mode':_0x5d129d,'validateComponent':_0x513541}),_0x572eb1=_0x1510dc[_0xce97a6(0x1f2)][_0xce97a6(0x1e7)](_0x53903d);if(_0x572eb1['length']>0x0){const _0x442528=_0x572eb1['map'](toSDKCompatibleA2UIMessage);_0xe27946['processMessages'](_0x442528),_0x53903d+=_0x572eb1['length'],_0x1b9a82=!![];}}catch(_0x51fcbf){_0x452095({'message':_0x51fcbf instanceof Error?_0x51fcbf['message']:String(_0x51fcbf)}),_0x1b9a82=!![];}_0x545125();if(_0x1b9a82)_0xd19272();},_0x505f38=()=>{const _0x4634f8=_0x32243d;if(_0xcc6a92)return;_0x46bfe8();const _0x4ce3cc=Array['from'](_0xe27946['model']['surfacesMap'][_0x4634f8(0x1f0)]());for(const _0x507c64 of _0x4ce3cc){_0xe27946[_0x4634f8(0x1e1)][_0x4634f8(0x1ff)](_0x507c64);}_0x1a743f=void 0x0,_0x53a4f2['length']=0x0,_0x545125(),_0xd19272();},_0x3beed0=()=>{if(_0xcc6a92)return;_0x46bfe8(),_0xcc6a92=!![],_0x2228b8(),_0xe27946['model']['dispose'](),_0x304d02['clear']();},_0x1a485a=_0x38eeb3=>{const _0x22bf39=_0x32243d;if(_0xcc6a92)return()=>{};return _0x304d02[_0x22bf39(0x208)](_0x38eeb3),()=>{const _0x3b8596=_0x22bf39;_0x304d02[_0x3b8596(0x20c)](_0x38eeb3);};},_0x59554a=()=>{if(_0xcc6a92)return;_0x46bfe8();if(_0x53a4f2['length']===0x0)return;_0x53a4f2['length']=0x0,_0xd19272();};return{'ingest':_0x586a5e,'ingestTransaction':_0x468458,'ingestStreaming':_0xe8c9d2,'endStream':_0x5502e4,'reset':_0x505f38,'clearErrors':_0x59554a,'dispose':_0x3beed0,'getState':_0x246a5c,'subscribe':_0x1a485a,'getClientCapabilities':_0x300459=>_0xe27946['getClientCapabilities'](_0x300459),'getClientDataModel':()=>_0xe27946[_0x32243d(0x20e)]()};}export{createUIRuntime};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentic-ui-experience/ui-runtime",
3
- "version": "0.0.1-beta.3",
3
+ "version": "0.0.1-beta.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@a2ui/web_core": "0.9.2",
26
26
  "zod": "^3.25.76",
27
- "@agentic-ui-experience/ui-core": "0.0.1-beta.3"
27
+ "@agentic-ui-experience/ui-core": "0.0.1-beta.4"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@a2ui/react": "0.9.0"
@@ -33,6 +33,7 @@
33
33
  "build": "node ../../scripts/build-obfuscated-package.mjs .",
34
34
  "dev": "tsc -b -w --preserveWatchOutput --force",
35
35
  "clean": "rm -rf dist tsconfig.tsbuildinfo",
36
- "test": "pnpm run build && node --test \"tests/**/*.test.mjs\""
36
+ "test:types": "tsc --noEmit -p tests/tsconfig.json",
37
+ "test": "pnpm run build && pnpm run test:types && node --test \"tests/**/*.test.mjs\""
37
38
  }
38
39
  }