@servicetitan/json-render-react 0.3.2-anv-5204-0ef51ea → 0.3.2-anv-5204-fe8283d

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
@@ -101,7 +101,7 @@ Default exports (`registry`, `handlers`, `executeAction`) use the **chat** regis
101
101
  2. Agent emits a `Spec` (`root`, `elements`, optional `state`).
102
102
  3. Host calls `getRegistry("chat")` and renders with `SpecRenderer`.
103
103
  4. `SpecRenderer` enriches the spec (e.g. auto-wires `Button` press → `atlas.submitUserAction`), creates a state store, and mounts json-render's `Renderer`.
104
- 5. User interaction fires catalog actions; host `actions` factory handles `atlas.submitUserAction`, `atlas.navigate`, `atlas.toolCall`.
104
+ 5. User interaction fires catalog actions; host `actions` factory handles `atlas.submitUserAction`, `atlas.navigate`, `atlas.artifactToolCall`.
105
105
  6. Backend returns an updated spec via `MessageUpdated` (Atlas).
106
106
 
107
107
  See [Atlas gen-ui docs](https://atlas-docs.st.dev/#/gen-ui-docs) for host integration.
@@ -220,7 +220,7 @@ Global action catalog in `src/core/actions.ts`:
220
220
  | --- | --- | --- |
221
221
  | `atlas.submitUserAction` | `actionId?`, `data?` | Submit form snapshot to agent backend |
222
222
  | `atlas.navigate` | `url` | Route internally or open external URL |
223
- | `atlas.toolCall` | `tool`, `args?` | Invoke MCP tool on artifact panel app |
223
+ | `atlas.artifactToolCall` | `tool`, `args?` | Invoke MCP tool on artifact panel app |
224
224
  | `setState` | `statePath`, `value` | Synchronous local state update (json-render built-in) |
225
225
 
226
226
  `Button` elements without explicit `on.press` are auto-wired to `atlas.submitUserAction` using the element key as `actionId`.
@@ -70,7 +70,7 @@ AVAILABLE ACTIONS:
70
70
  - validateForm: Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }. [built-in]
71
71
  - atlas.submitUserAction: Submit form data. actionId overrides default "form_submit" identifier.
72
72
  - atlas.navigate: Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app.
73
- - atlas.toolCall: Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.
73
+ - atlas.artifactToolCall: Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.
74
74
 
75
75
  EVENTS (the `on` field):
76
76
  Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props.
@@ -78,7 +78,7 @@ AVAILABLE ACTIONS:
78
78
  - validateForm: Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }. [built-in]
79
79
  - atlas.submitUserAction: Submit form data. actionId overrides default "form_submit" identifier.
80
80
  - atlas.navigate: Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app.
81
- - atlas.toolCall: Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.
81
+ - atlas.artifactToolCall: Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.
82
82
 
83
83
  EVENTS (the `on` field):
84
84
  Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props.
@@ -79,7 +79,7 @@ AVAILABLE ACTIONS:
79
79
  - validateForm: Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }. [built-in]
80
80
  - atlas.submitUserAction: Submit form data. actionId overrides default "form_submit" identifier.
81
81
  - atlas.navigate: Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app.
82
- - atlas.toolCall: Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.
82
+ - atlas.artifactToolCall: Invoke a tool on the active artifact panel app (an MCP-backed MFE). args is the tool argument payload; if omitted the current form state is sent.
83
83
 
84
84
  EVENTS (the `on` field):
85
85
  Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props.
@@ -39,7 +39,7 @@ export declare const contextCatalog: import('@json-render/core').Catalog<{
39
39
  }, import('zod/v4/core').$strip>;
40
40
  description: string;
41
41
  };
42
- "atlas.toolCall": {
42
+ "atlas.artifactToolCall": {
43
43
  params: import('zod').ZodObject<{
44
44
  tool: import('zod').ZodString;
45
45
  args: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>>;
@@ -13,7 +13,7 @@ export declare const actionsCatalog: {
13
13
  }, z.core.$strip>;
14
14
  description: string;
15
15
  };
16
- "atlas.toolCall": {
16
+ "atlas.artifactToolCall": {
17
17
  params: z.ZodObject<{
18
18
  tool: z.ZodString;
19
19
  args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -24,5 +24,5 @@ export declare const actionsCatalog: {
24
24
  export declare const actionsHandlers: {
25
25
  "atlas.submitUserAction": (_params: unknown) => Promise<void>;
26
26
  "atlas.navigate": (_params: unknown) => Promise<void>;
27
- "atlas.toolCall": (_params: unknown) => Promise<void>;
27
+ "atlas.artifactToolCall": (_params: unknown) => Promise<void>;
28
28
  };
@@ -476,7 +476,7 @@ export declare const catalog: import('@json-render/core').Catalog<{
476
476
  }, import('zod/v4/core').$strip>;
477
477
  description: string;
478
478
  };
479
- "atlas.toolCall": {
479
+ "atlas.artifactToolCall": {
480
480
  params: import('zod').ZodObject<{
481
481
  tool: import('zod').ZodString;
482
482
  args: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodUnknown>>;
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { guidanceCardCatalog } from './guidance-card.catalog';
3
3
  export { guidanceCardCatalog };
4
- export declare const GuidanceCardRenderer: ({ props, emit, }: {
4
+ export declare const GuidanceCardRenderer: ({ props, emit, bindings, }: {
5
5
  props: z.infer<typeof guidanceCardCatalog.props>;
6
6
  emit: (event: string) => void;
7
+ bindings?: Record<string, string>;
7
8
  }) => import("react/jsx-runtime").JSX.Element;
package/dist/index.js CHANGED
@@ -779,7 +779,7 @@ var Ln = ({ props: e }) => /* @__PURE__ */ S("div", {
779
779
  params: w.object({ url: w.string() }),
780
780
  description: "Navigate to a URL or internal route. External URLs (http/https) open in a new tab; internal route strings navigate within the app."
781
781
  },
782
- "atlas.toolCall": {
782
+ "atlas.artifactToolCall": {
783
783
  params: w.object({
784
784
  tool: w.string(),
785
785
  args: w.record(w.string(), w.unknown()).optional()
@@ -789,7 +789,7 @@ var Ln = ({ props: e }) => /* @__PURE__ */ S("div", {
789
789
  }, Rn = {
790
790
  "atlas.submitUserAction": async (e) => {},
791
791
  "atlas.navigate": async (e) => {},
792
- "atlas.toolCall": async (e) => {}
792
+ "atlas.artifactToolCall": async (e) => {}
793
793
  }, zn = {
794
794
  props: w.object({
795
795
  title: w.string(),
@@ -1711,8 +1711,10 @@ function Xr(e) {
1711
1711
  };
1712
1712
  return e.minWidth !== void 0 && (t.minWidth = Yr(e.minWidth)), t;
1713
1713
  }
1714
- var Zr = ({ props: e, emit: t }) => {
1715
- let n = e.changeSections.map((e) => e.type === "single" ? {
1714
+ var Zr = ({ props: e, emit: t, bindings: n }) => {
1715
+ let { set: r } = O(), i = n?.appliedChangeIds, a = (e) => {
1716
+ i && r(i, e);
1717
+ }, o = e.changeSections.map((e) => e.type === "single" ? {
1716
1718
  type: "single",
1717
1719
  changes: e.changes.map((e) => ({
1718
1720
  id: e.id,
@@ -1733,15 +1735,19 @@ var Zr = ({ props: e, emit: t }) => {
1733
1735
  });
1734
1736
  return /* @__PURE__ */ S(ue, {
1735
1737
  referenceLabel: e.referenceLabel,
1736
- changeSections: n,
1738
+ changeSections: o,
1737
1739
  ...X({
1738
1740
  state: e.state,
1739
1741
  referenceHref: e.referenceHref,
1740
1742
  appliedChangeIds: e.appliedChangeIds,
1741
1743
  defaultExpanded: e.defaultExpanded
1742
1744
  }),
1743
- onApply: () => t("apply"),
1744
- onEdit: () => t("edit"),
1745
+ onApply: (e) => {
1746
+ a(e), t("apply");
1747
+ },
1748
+ onEdit: (e) => {
1749
+ a(e), t("edit");
1750
+ },
1745
1751
  onDismiss: () => t("dismiss")
1746
1752
  });
1747
1753
  }, Qr = {