@salesforce/afv-skills 1.31.0 → 1.32.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/package.json +1 -1
- package/skills/agentforce-bot-upgrade/SKILL.md +217 -0
- package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +242 -0
- package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +128 -0
- package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +208 -0
- package/skills/agentforce-bot-upgrade/references/input-contract.md +101 -0
- package/skills/agentforce-bot-upgrade/references/mapping-rules.md +113 -0
- package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +78 -0
- package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +67 -0
- package/skills/agentforce-bot-upgrade/references/quality-checklist.md +33 -0
- package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +116 -0
- package/skills/dx-devops-work-item-manage/SKILL.md +270 -0
- package/skills/dx-devops-work-item-manage/examples/common-workflows.md +479 -0
- package/skills/dx-devops-work-item-manage/references/cli-commands.md +476 -0
- package/skills/dx-org-manage/SKILL.md +8 -5
- package/skills/dx-org-trial-expiration-check/SKILL.md +239 -0
- package/skills/dx-org-trial-expiration-check/scripts/check_expiration.sh +588 -0
- package/skills/experience-ui-bundle-app-coordinate/SKILL.md +12 -9
- package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +29 -5
- package/skills/experience-ui-bundle-custom-app-generate/references/configure-metadata-custom-application.md +1 -1
- package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +30 -0
- package/skills/experience-ui-bundle-features-generate/SKILL.md +86 -11
- package/skills/experience-ui-bundle-features-generate/references/conflict-resolution-schema.json +20 -0
- package/skills/experience-ui-bundle-features-generate/scripts/verify-react-bundle.sh +14 -0
- package/skills/experience-ui-bundle-frontend-generate/SKILL.md +6 -1
- package/skills/experience-ui-bundle-frontend-generate/references/component.md +34 -1
- package/skills/experience-ui-bundle-frontend-generate/references/page.md +1 -1
- package/skills/experience-ui-bundle-project-generate/SKILL.md +111 -0
- package/skills/experience-ui-bundle-project-generate/scripts/flatten-project.mjs +33 -0
- package/skills/platform-custom-lightning-type-generate/SKILL.md +9 -14
- package/skills/platform-custom-lightning-type-generate/references/widget-rendition.md +27 -111
- package/skills/platform-lightning-type-widget-coordinate/SKILL.md +214 -0
- package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +80 -0
- package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +75 -0
- package/skills/platform-lightning-type-widget-coordinate/references/build-plan-format.md +67 -0
- package/skills/platform-lightning-type-widget-coordinate/references/lightning-type-discovery.md +124 -0
- package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +130 -0
- package/skills/platform-sharing-owd-configure/SKILL.md +142 -0
- package/skills/platform-sharing-owd-configure/examples/get_owd_output.md +38 -0
- package/skills/platform-sharing-owd-configure/examples/update_owd_output.md +44 -0
- package/skills/platform-sharing-owd-configure/references/access_levels.md +49 -0
- package/skills/platform-sharing-owd-configure/references/metadata_api_approach.md +69 -0
- package/skills/platform-sharing-rules-generate/SKILL.md +89 -19
- package/skills/platform-sharing-rules-generate/examples/test-cases.md +381 -0
- package/skills/platform-widget-generate/SKILL.md +241 -0
- package/skills/platform-widget-generate/examples/conditional.json +73 -0
- package/skills/platform-widget-generate/examples/list-with-foreach.json +66 -0
- package/skills/platform-widget-generate/examples/single-object.json +64 -0
- package/skills/platform-widget-generate/references/schema-from-lightning-type.md +76 -0
- package/skills/platform-widget-generate/references/widget-bundle-layout.md +116 -0
- package/skills/platform-widget-generate/references/widget-meta-directives.md +130 -0
- package/skills/sales-agentforce-pipeline-management-configure/SKILL.md +268 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/field-completion-template.genAiPromptTemplate-meta.xml +141 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/pipeline_management_flow.flow-meta.xml +548 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.agent +2938 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/sales_management_agent.bundle-meta.xml +4 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/sfdx-project.json +12 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/bant.txt +11 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/meddic.txt +11 -0
- package/skills/sales-agentforce-pipeline-management-configure/assets/stage-descriptions/spiced.txt +11 -0
- package/skills/sales-agentforce-pipeline-management-configure/examples/custom-prompt-instructions.md +317 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/admin-communication.md +355 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/agent-creation.md +383 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/auth-and-cli.md +146 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/automation-matrix.md +23 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/autonomous-updates.md +215 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/canonical-agent-path.md +75 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/data-sources.md +155 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompt-template.md +120 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/field-completion-prompts.md +149 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/flags.md +13 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/flow-clone-from-template.md +447 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/metadata-inventory.md +330 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/opportunity-stages.md +246 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/repair-diagnostics.md +265 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/setup-order.md +263 -0
- package/skills/sales-agentforce-pipeline-management-configure/references/soap-api-enablement.md +528 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/CHANGES.md +180 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/README.md +56 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/add-field-suggestion.sh +679 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/create-agent.sh +302 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/create-flow.sh +250 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/define-agent-access.sh +430 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/deploy-settings.sh +77 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-deal-agent.sh +241 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/enable-prerequisites.sh +538 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/flow-debug-and-verify.sh +385 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/retrieve-settings.sh +131 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/setup-all.sh +2791 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-bundle-publish.sh +189 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/agent-detection.sh +239 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/flow-builder.sh +238 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/psg.sh +48 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/soap.sh +140 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/stage-descriptions.sh +448 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/shared/test-opp.sh +166 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-all.sh +636 -0
- package/skills/sales-agentforce-pipeline-management-configure/scripts/verify-prompt-generation.sh +346 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: platform-widget-generate
|
|
3
|
+
description: "Use this skill to author a complete HXL WidgetBundle (UEM body + schema.json + -meta.xml). TRIGGER when: user asks for a widget, mosaic, fragment, card, or rich UI surface for any subject, domain, feature, or entity noun; the prompt names only an entity or data shape without invoking Lightning Types, CLTs, or Apex-backed types. DO NOT TRIGGER when: the prompt explicitly says 'Lightning Type', 'CLT', 'Custom Lightning Type', 'Apex-backed type', or references '@apexClassType/...' (use platform-lightning-type-widget-coordinate); authoring a custom-LWC renderer for a Custom Lightning Type (use platform-custom-lightning-type-generate); or editing only an LWC component."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.1"
|
|
6
|
+
minApiVersion: "68.0"
|
|
7
|
+
relatedSkills:
|
|
8
|
+
- "platform-lightning-type-widget-coordinate"
|
|
9
|
+
- "platform-custom-lightning-type-generate"
|
|
10
|
+
mcpTools:
|
|
11
|
+
metadata-experts:
|
|
12
|
+
tools: ["execute_metadata_action"]
|
|
13
|
+
semver: ">=1.0.0"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Generating a Widget Bundle
|
|
17
|
+
|
|
18
|
+
Author a complete WidgetBundle: a UEM tree (`tile/widget`), a JSON Schema describing the widget's input contract, and the `.uiwidget-meta.xml` that registers the bundle.
|
|
19
|
+
|
|
20
|
+
## When to Use This Skill
|
|
21
|
+
|
|
22
|
+
Use when the user asks for a widget, mosaic, fragment, or card-style rich UI surface. Do not use this skill for custom-LWC renderers or for `renderer.json` files inside a Custom Lightning Type bundle — those belong to `platform-custom-lightning-type-generate`.
|
|
23
|
+
|
|
24
|
+
## Inputs
|
|
25
|
+
|
|
26
|
+
- **`widgetName`** (required) — `camelCase` identifier; becomes the directory name under `uiWidgets/`.
|
|
27
|
+
- A **shape** — what data the widget renders. The widget cannot be generated without it. The shape arrives one of two ways, in priority order:
|
|
28
|
+
1. **`lightningTypeSchema`** — `{ path, apexClassFqn }` for an existing Apex-backed Lightning Type. The FQN takes one of two forms: outer-class (`<namespace>__<ClassName>`) where the outer class is the payload, or inner-class (`<namespace>__<ClassName>$<InnerClass>`) where the named inner class is the payload. Passed in by the `platform-lightning-type-widget-coordinate` orchestrator. When present, derive per `references/schema-from-lightning-type.md`.
|
|
29
|
+
2. **Extracted from the user's prompt** — when no `lightningTypeSchema` is passed, infer the shape directly from what the user wrote: a pasted JSON payload, an enumerated field list ("id as string, total as number"), or descriptive prose. The output is the same ordered list of `{ name, type, required }` either way.
|
|
30
|
+
|
|
31
|
+
If neither source yields a shape, STOP and ask the user before proceeding.
|
|
32
|
+
|
|
33
|
+
## Output
|
|
34
|
+
|
|
35
|
+
Three files in `<pkgDir>/uiWidgets/<widgetName>/`:
|
|
36
|
+
|
|
37
|
+
| File | Content |
|
|
38
|
+
|---|---|
|
|
39
|
+
| `<widgetName>.json` | Widget envelope — `{ "type": "lightning__agentforceWidget", "contentBody": { "widgetBody": { UEM tree rooted at tile/widget } } }` |
|
|
40
|
+
| `schema.json` | JSON Schema — root has `type: "object"` + `properties.attributes` wrapper carrying `lightning:type: "lightning__objectType"` and the field `properties` |
|
|
41
|
+
| `<widgetName>.uiwidget-meta.xml` | `<UiWidgetBundle>` element with `<masterLabel>`, `<description>`, and `<widgetType>JSON</widgetType>` |
|
|
42
|
+
|
|
43
|
+
See `references/widget-bundle-layout.md` for the `<pkgDir>` resolution procedure and the exact `<widgetName>.uiwidget-meta.xml` shape.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Composition
|
|
48
|
+
|
|
49
|
+
A widget body is a UEM tree of blocks nested under `contentBody.widgetBody`. The root node is `tile/widget`. Every node — root and non-root — has the same shape: no `type` key; just `definition`, optional `attributes`, optional `meta`, and optional `children`. Block shape:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
interface Block {
|
|
53
|
+
definition: string // {namespace}/{blockName} — root is "tile/widget"
|
|
54
|
+
attributes?: Record<string, any>
|
|
55
|
+
meta?: { // see references/widget-meta-directives.md
|
|
56
|
+
forEach?: string
|
|
57
|
+
forItem?: string
|
|
58
|
+
if?: string
|
|
59
|
+
}
|
|
60
|
+
children?: Block[]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The first child of `tile/widget.children` SHOULD be a single `tile/column` (or a single `tile/card`). All widget content typically goes inside that first child for predictable vertical structure across surfaces.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Available Metadata Actions
|
|
69
|
+
|
|
70
|
+
### discoverUiComponents
|
|
71
|
+
|
|
72
|
+
**Purpose:** Discover the palette of blocks available for composition.
|
|
73
|
+
|
|
74
|
+
**Required parameters:** `actionName: "discoverUiComponents"`, `metadataType: "FRAGMENT"`, `parameters.pageType: "FRAGMENT"`. Optional: `searchQuery` to filter by name/description.
|
|
75
|
+
|
|
76
|
+
**Returns:** list of `{ definition, description, label, attributes? }`.
|
|
77
|
+
|
|
78
|
+
### getUiComponentSchemas
|
|
79
|
+
|
|
80
|
+
**Purpose:** Fetch JSON schemas (property types, required vs optional, validation) for selected blocks.
|
|
81
|
+
|
|
82
|
+
**Required parameters:** `actionName: "getUiComponentSchemas"`, `metadataType: "FRAGMENT"`, `parameters.pageType: "FRAGMENT"`, `parameters.componentDefinitions: ["namespace/definition", ...]`. Optional: `includeKnowledge` (default `true`).
|
|
83
|
+
|
|
84
|
+
**Returns:** `componentSchemas[]` — success entries carry the JSON schema, failure entries carry an error message. Partial failures are supported.
|
|
85
|
+
|
|
86
|
+
> Never pass `tile/widget` to `getUiComponentSchemas` — it is a fixed wrapper, not a queryable component.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Attribute Binding
|
|
91
|
+
|
|
92
|
+
- Bind a block property to runtime data with `{!$attrs.<attrName>}`. `<attrName>` MUST match a property name in `schema.json`.
|
|
93
|
+
- Inside a `forEach`, reference the loop variable instead — e.g. `"text": "{!$item.name}"`. See `references/widget-meta-directives.md`.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Layout Best Practices
|
|
98
|
+
|
|
99
|
+
These conventions cover widget *structure* — how blocks are grouped and stacked.
|
|
100
|
+
|
|
101
|
+
| Primitive | Purpose | When to use |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| `tile/column` | Vertical stack of children | Root wrapper, and any group of blocks that should stack |
|
|
104
|
+
| `tile/row` | Horizontal stack of children | Two or more blocks that belong on the same line |
|
|
105
|
+
| `tile/card` | Visually-boxed group | A bounded section that should read as one unit |
|
|
106
|
+
| `tile/spacer` | Whitespace between blocks | When extra space is needed between content groups |
|
|
107
|
+
|
|
108
|
+
- **Sectioning:** Separate major content groups with a fresh `tile/card`-bounded section. Do not nest cards inside cards.
|
|
109
|
+
- **Nesting:** Prefer flat layouts. Only nest a `tile/column` inside a `tile/row` (or vice versa) when the visual orientation actually changes for that subgroup.
|
|
110
|
+
- **Authoritative palette:** the table above lists *typical* layout primitives. Always confirm a block exists by inspecting `discoverUiComponents` output — do not assume a block name from this table without seeing it in the discovery response.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Styling Best Practices
|
|
115
|
+
|
|
116
|
+
Widgets express *intent*, not pixels. Each surface provides a default look and feel; brand/theme overrides apply automatically.
|
|
117
|
+
|
|
118
|
+
- **Style semantically.** Use `variant`, `size`, and other enum-typed attributes (`primary`, `destructive`, `success`, `warning`). Do not pin literal colors or pixel values.
|
|
119
|
+
- **One primary action per visible group.** At most one `tile/button` with `variant: primary`. Use `secondary`, `outline`, or `ghost` for additional actions.
|
|
120
|
+
- **One `h1` per widget.** Use `h2`/`h3` for sub-section headings, `body` for prose, `caption` for helper text.
|
|
121
|
+
- **Use semantic state variants on state-bearing blocks** (`tile/alert`, `tile/badge`, `tile/callout`, `tile/chip`).
|
|
122
|
+
- **Accept schema defaults for `gap`, `padding`, `size`** unless there is a specific reason to override.
|
|
123
|
+
- **Don't pin `width`, `height`, `maxWidth`** unless a content constraint requires it. For long text, use `truncate: true`.
|
|
124
|
+
- **Use the Lucide icon set.** Pass the Lucide name (`"check"`, `"alert-circle"`); other icon libraries are not supported.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Workflow
|
|
129
|
+
|
|
130
|
+
1. **Resolve the widget spec** — an ordered list of `{ name, type, required }`. Source depends on which input was provided (see *Inputs*):
|
|
131
|
+
- If `lightningTypeSchema` was passed by the orchestrator → derive per `references/schema-from-lightning-type.md`.
|
|
132
|
+
- Otherwise → infer the list directly from the user prompt (pasted JSON payload, enumerated field list, or descriptive prose).
|
|
133
|
+
|
|
134
|
+
2. **Discover blocks (REQUIRED — do NOT skip).** Call the `discoverUiComponents` metadata action via `execute_metadata_action`. Use property types from the widget spec to seed `searchQuery` (text → `"text"`, number → `"number"`). **If `discoverUiComponents` returns `success: false`, an error, or an empty list, STOP and surface the error verbatim — do not improvise block names from memory, prior runs, or training data. Re-run discover with a different `searchQuery` only if the failure is search-query-specific.**
|
|
135
|
+
|
|
136
|
+
3. **Select blocks.** Choose one block per widget-spec property, plus structural primitives from *Layout Best Practices*.
|
|
137
|
+
|
|
138
|
+
4. **Get block schemas (REQUIRED — do NOT skip).** Call the `getUiComponentSchemas` metadata action via `execute_metadata_action` for the selected blocks. Review property metadata. **If `componentSchemas` returns all-failure or empty, STOP and surface the error — do not improvise from existing widgets in the project.**
|
|
139
|
+
|
|
140
|
+
5. **Build the UEM tree (example reads REQUIRED — do NOT skip).** First, identify which patterns match the widget spec and read each matching example file from this skill's own `examples/` directory (`<skill-root>/examples/`):
|
|
141
|
+
|
|
142
|
+
| Pattern in the spec | Example to read |
|
|
143
|
+
|---|---|
|
|
144
|
+
| Single object (no iteration) | `<skill-root>/examples/single-object.json` |
|
|
145
|
+
| Any list iteration (root-level array, nested list, or list embedded in a single-object widget) | `<skill-root>/examples/list-with-foreach.json` |
|
|
146
|
+
| Conditional rendering (`if` bound to a boolean) | `<skill-root>/examples/conditional.json` |
|
|
147
|
+
|
|
148
|
+
A spec may match multiple patterns (e.g. a list of items where some items render conditionally reads both `list-with-foreach.json` and `conditional.json`). **Read every matching example, and only those — do not skip the read because the pattern feels familiar.**
|
|
149
|
+
|
|
150
|
+
Then:
|
|
151
|
+
- Map each widget-spec property to a block property; preserve spec order.
|
|
152
|
+
- **Decide root iteration:** single object → properties directly under root `tile/column`. Collection → wrap repeating block in `forEach`/`forItem`. See `references/widget-meta-directives.md`.
|
|
153
|
+
- Bind values with `{!$attrs.X}` (or `{!$item.X}` inside `forEach`).
|
|
154
|
+
- For conditional blocks, add `"if"` on `meta` — only when the schema has a matching `lightning__booleanType` property.
|
|
155
|
+
|
|
156
|
+
6. **Author `schema.json`.** Build the JSON Schema from the widget spec. Fields live one level deep under an `attributes` wrapper:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"title": "<Widget Display Name>",
|
|
161
|
+
"description": "<one line about what the widget shows>",
|
|
162
|
+
"type": "object",
|
|
163
|
+
"properties": {
|
|
164
|
+
"attributes": {
|
|
165
|
+
"lightning:type": "lightning__objectType",
|
|
166
|
+
"properties": {
|
|
167
|
+
"<propertyName>": {
|
|
168
|
+
"title": "<label>",
|
|
169
|
+
"description": "<short description>",
|
|
170
|
+
"lightning:type": "<lightning__textType | lightning__numberType | ...>"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Required root keys:** `title`, `type: "object"`, `properties.attributes` (with `lightning:type: "lightning__objectType"` and a nested `properties` map). See `references/schema-from-lightning-type.md` for full primitive type guidance.
|
|
179
|
+
|
|
180
|
+
7. **Author `<widgetName>.uiwidget-meta.xml`.** See `references/widget-bundle-layout.md` for the exact shape.
|
|
181
|
+
|
|
182
|
+
8. **Resolve `<pkgDir>` and write the bundle.** Follow the procedure in `references/widget-bundle-layout.md` (`## Resolving <pkgDir>`). A widget bundle is a **three-file set** — all three files must be written in the same step; a bundle with fewer than three files is incomplete and will not deploy.
|
|
183
|
+
|
|
184
|
+
```text
|
|
185
|
+
<pkgDir>/uiWidgets/<widgetName>/<widgetName>.json # widget envelope — UEM tree (primary artifact)
|
|
186
|
+
<pkgDir>/uiWidgets/<widgetName>/schema.json # attribute contract for the envelope
|
|
187
|
+
<pkgDir>/uiWidgets/<widgetName>/<widgetName>.uiwidget-meta.xml # UiWidgetBundle registration
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Each file has a distinct role:
|
|
191
|
+
- `<widgetName>.json` — the widget envelope with the `tile/widget` UEM tree. This is the primary artifact; `schema.json` is its companion contract, not a substitute.
|
|
192
|
+
- `schema.json` — the JSON Schema for the attributes referenced by `{!$attrs.X}` bindings in the envelope.
|
|
193
|
+
- `<widgetName>.uiwidget-meta.xml` — the `UiWidgetBundle` element that registers the bundle for source tracking and deployment.
|
|
194
|
+
|
|
195
|
+
Write all three before proceeding to self-validation.
|
|
196
|
+
|
|
197
|
+
9. **Self-validate.** Before reporting, confirm each check below and report each result individually (`pass` or `fail (<reason>)`). Do **not** summarize as a single "all passed" line — list every check so a reviewer can spot a silent skip.
|
|
198
|
+
- **`schema-parses`** — `<pkgDir>/uiWidgets/<widgetName>/schema.json` parses as JSON.
|
|
199
|
+
- **`schema-root-keys`** — root has `title` (string), `type: "object"`, and `properties.attributes` (object) — where `properties.attributes` carries `lightning:type: "lightning__objectType"` and a nested `properties` map. No `unevaluatedProperties: false`.
|
|
200
|
+
- **`schema-leaf-types`** — every leaf under `properties.attributes.properties` carries a `lightning:type`. Singular nested inner-class fields appear as `lightning__objectType`; the nested shape is not redeclared.
|
|
201
|
+
- **`bindings-resolve`** — every `{!$attrs.X}` (or `{!$attrs.<outerField>.<innerField>}` for nested objects) in `<widgetName>.json` resolves to a property under `schema.json` `properties.attributes.properties`, and every `{!$item.X}` resolves to a `forItem` loop variable defined upstream.
|
|
202
|
+
- **`body-envelope`** — `<widgetName>.json` root has `type: "lightning__agentforceWidget"` and a `contentBody` object whose `widgetBody` carries the UEM tree rooted at `tile/widget`. No node in the tree — root or non-root — carries a `type` key.
|
|
203
|
+
- **`metaxml-wellformed`** — `<widgetName>.uiwidget-meta.xml` parses as well-formed XML.
|
|
204
|
+
- **`metaxml-elements`** — `<widgetName>.uiwidget-meta.xml` has root `<UiWidgetBundle>` and contains `<masterLabel>` (non-empty), `<description>` (non-empty), and `<widgetType>JSON</widgetType>`.
|
|
205
|
+
- **`files-present`** — all three files exist at the resolved `<pkgDir>/uiWidgets/<widgetName>/` path.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Rules / Constraints
|
|
210
|
+
|
|
211
|
+
| Constraint | Rationale |
|
|
212
|
+
|---|---|
|
|
213
|
+
| Block definitions follow `{namespace}/{blockName}` and must match `discoverUiComponents` output | Runtime resolves blocks by exact definition string |
|
|
214
|
+
| Never pass `tile/widget` to `getUiComponentSchemas` | It is a fixed wrapper, not a queryable component |
|
|
215
|
+
| Always supply `parameters` (with required keys) when calling `execute_metadata_action` | Missing parameters cause hard failure, not partial result |
|
|
216
|
+
| Every `{!$attrs.X}` in the body resolves to a property in the widget `schema.json` | No invented fields |
|
|
217
|
+
| No `$(…)`, backticks, `<(…)`, brace expansion `{a,b,c}`, or `eval`/`exec` in any Bash tool call | Vibes' safe-shell filter forces manual approval on these patterns even in Bypass mode. Emit separate commands (`mkdir -p a && mkdir -p b`) or print each value with its own command and reason about the output — do not capture into a shell variable |
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Gotchas
|
|
222
|
+
|
|
223
|
+
| Issue | Resolution |
|
|
224
|
+
|---|---|
|
|
225
|
+
| `getUiComponentSchemas` returns a partial-failure entry | Pick a different block from `discoverUiComponents`; do not silently continue without a schema |
|
|
226
|
+
| Body references `{!$attrs.foo}` but `foo` is not under `schema.json` `properties.attributes.properties` | Add `foo` to `schema.json` `properties.attributes.properties` OR remove the body reference |
|
|
227
|
+
| Output written outside `<pkgDir>/uiWidgets/<widgetName>/` | `<pkgDir>` = `<packageDirectories[].path>/main/default` (see `references/widget-bundle-layout.md`). Dropping the `main/default/` segment is the common cause of widgets landing at `force-app/uiWidgets/...` instead of `force-app/main/default/uiWidgets/...` |
|
|
228
|
+
| `if` bound to a non-boolean | Use `if` only when the schema has a `lightning__booleanType` property |
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Reference File Index
|
|
233
|
+
|
|
234
|
+
| File | When to read |
|
|
235
|
+
|---|---|
|
|
236
|
+
| `references/widget-meta-directives.md` | For `forEach` / `forItem` (iteration) and `if` (conditional rendering), including nested loops |
|
|
237
|
+
| `references/schema-from-lightning-type.md` | When `lightningTypeSchema` is provided; how to derive the widget `schema.json` from an Apex-backed Lightning Type |
|
|
238
|
+
| `references/widget-bundle-layout.md` | Folder layout, `-meta.xml` shape, `<pkgDir>` resolution rules |
|
|
239
|
+
| `examples/single-object.json` | Single-object pattern (root binding via `{!$attrs.X}`, no iteration) |
|
|
240
|
+
| `examples/list-with-foreach.json` | Any list-iteration case — root-level collections, nested lists, and lists embedded inside a single-object widget (e.g. iterating a `List<InnerClass>` inside an outer Apex payload) |
|
|
241
|
+
| `examples/conditional.json` | Conditional pattern (`if` on `meta`, including `if` + `forEach` together) |
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "lightning__agentforceWidget",
|
|
3
|
+
"contentBody": {
|
|
4
|
+
"widgetBody": {
|
|
5
|
+
"definition": "tile/widget",
|
|
6
|
+
"children": [
|
|
7
|
+
{
|
|
8
|
+
"definition": "tile/column",
|
|
9
|
+
"attributes": { "gap": "md", "padding": "md" },
|
|
10
|
+
"children": [
|
|
11
|
+
{
|
|
12
|
+
"definition": "tile/callout",
|
|
13
|
+
"meta": { "if": "{!$attrs.showBanner}" },
|
|
14
|
+
"attributes": { "variant": "warning", "title": "Announcement" },
|
|
15
|
+
"children": [
|
|
16
|
+
{
|
|
17
|
+
"definition": "tile/text",
|
|
18
|
+
"attributes": { "text": "{!$attrs.bannerMessage}", "variant": "body" }
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"definition": "tile/card",
|
|
24
|
+
"meta": { "if": "{!$attrs.isVerified}" },
|
|
25
|
+
"attributes": { "padding": "md", "variant": "outlined" },
|
|
26
|
+
"children": [
|
|
27
|
+
{
|
|
28
|
+
"definition": "tile/row",
|
|
29
|
+
"attributes": { "gap": "sm", "align": "center" },
|
|
30
|
+
"children": [
|
|
31
|
+
{
|
|
32
|
+
"definition": "tile/icon",
|
|
33
|
+
"attributes": { "name": "check-circle", "color": "success" }
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"definition": "tile/text",
|
|
37
|
+
"attributes": { "text": "{!$attrs.welcomeMessage}", "variant": "body" }
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"definition": "tile/card",
|
|
45
|
+
"meta": {
|
|
46
|
+
"forEach": "{!$attrs.tasks}",
|
|
47
|
+
"forItem": "$task",
|
|
48
|
+
"if": "{!$task.isUrgent}"
|
|
49
|
+
},
|
|
50
|
+
"attributes": { "padding": "md", "variant": "outlined" },
|
|
51
|
+
"children": [
|
|
52
|
+
{
|
|
53
|
+
"definition": "tile/row",
|
|
54
|
+
"attributes": { "gap": "md", "justify": "between", "align": "center" },
|
|
55
|
+
"children": [
|
|
56
|
+
{
|
|
57
|
+
"definition": "tile/text",
|
|
58
|
+
"attributes": { "text": "{!$task.title}", "variant": "h4" }
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"definition": "tile/badge",
|
|
62
|
+
"attributes": { "label": "{!$task.priority}", "variant": "secondary" }
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "lightning__agentforceWidget",
|
|
3
|
+
"contentBody": {
|
|
4
|
+
"widgetBody": {
|
|
5
|
+
"definition": "tile/widget",
|
|
6
|
+
"children": [
|
|
7
|
+
{
|
|
8
|
+
"definition": "tile/column",
|
|
9
|
+
"attributes": { "gap": "md", "padding": "md" },
|
|
10
|
+
"children": [
|
|
11
|
+
{
|
|
12
|
+
"definition": "tile/text",
|
|
13
|
+
"attributes": { "text": "{!$attrs.title}", "variant": "h1" }
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"definition": "tile/card",
|
|
17
|
+
"meta": { "forEach": "{!$attrs.products}", "forItem": "$product" },
|
|
18
|
+
"attributes": { "padding": "md", "variant": "outlined" },
|
|
19
|
+
"children": [
|
|
20
|
+
{
|
|
21
|
+
"definition": "tile/row",
|
|
22
|
+
"attributes": { "gap": "md", "justify": "between", "align": "center" },
|
|
23
|
+
"children": [
|
|
24
|
+
{
|
|
25
|
+
"definition": "tile/column",
|
|
26
|
+
"attributes": { "gap": "xs" },
|
|
27
|
+
"children": [
|
|
28
|
+
{
|
|
29
|
+
"definition": "tile/text",
|
|
30
|
+
"attributes": { "text": "{!$product.name}", "variant": "h3" }
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"definition": "tile/text",
|
|
34
|
+
"attributes": { "text": "{!$product.category}", "variant": "caption", "color": "muted" }
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"definition": "tile/text",
|
|
40
|
+
"attributes": { "text": "{!$product.price}", "variant": "h4", "color": "primary" }
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"definition": "tile/row",
|
|
46
|
+
"attributes": { "gap": "sm", "align": "center" },
|
|
47
|
+
"meta": { "forEach": "{!$product.features}", "forItem": "$feature" },
|
|
48
|
+
"children": [
|
|
49
|
+
{
|
|
50
|
+
"definition": "tile/icon",
|
|
51
|
+
"attributes": { "name": "{!$feature.icon}", "size": "sm", "color": "success" }
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"definition": "tile/text",
|
|
55
|
+
"attributes": { "text": "{!$feature.label}", "variant": "caption", "color": "muted" }
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "lightning__agentforceWidget",
|
|
3
|
+
"contentBody": {
|
|
4
|
+
"widgetBody": {
|
|
5
|
+
"definition": "tile/widget",
|
|
6
|
+
"children": [
|
|
7
|
+
{
|
|
8
|
+
"definition": "tile/column",
|
|
9
|
+
"attributes": { "gap": "md", "padding": "md" },
|
|
10
|
+
"children": [
|
|
11
|
+
{
|
|
12
|
+
"definition": "tile/card",
|
|
13
|
+
"attributes": { "padding": "lg", "variant": "elevated" },
|
|
14
|
+
"children": [
|
|
15
|
+
{
|
|
16
|
+
"definition": "tile/text",
|
|
17
|
+
"attributes": { "text": "{!$attrs.title}", "variant": "h2" }
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"definition": "tile/text",
|
|
21
|
+
"attributes": { "text": "{!$attrs.subtitle}", "variant": "caption", "color": "muted" }
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"definition": "tile/column",
|
|
25
|
+
"attributes": { "gap": "sm" },
|
|
26
|
+
"children": [
|
|
27
|
+
{
|
|
28
|
+
"definition": "tile/row",
|
|
29
|
+
"attributes": { "gap": "sm" },
|
|
30
|
+
"children": [
|
|
31
|
+
{
|
|
32
|
+
"definition": "tile/text",
|
|
33
|
+
"attributes": { "text": "{!$attrs.field1Label}", "variant": "body", "weight": "semibold" }
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"definition": "tile/text",
|
|
37
|
+
"attributes": { "text": "{!$attrs.field1Value}", "variant": "body" }
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"definition": "tile/row",
|
|
43
|
+
"attributes": { "gap": "sm" },
|
|
44
|
+
"children": [
|
|
45
|
+
{
|
|
46
|
+
"definition": "tile/text",
|
|
47
|
+
"attributes": { "text": "{!$attrs.field2Label}", "variant": "body", "weight": "semibold" }
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"definition": "tile/text",
|
|
51
|
+
"attributes": { "text": "{!$attrs.field2Value}", "variant": "body" }
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Deriving Widget schema.json From a Lightning Type
|
|
2
|
+
|
|
3
|
+
When the orchestrator passes a `lightningTypeSchema` (with `path` and `apexClassFqn`), the widget bundle's `schema.json` is derived from the Apex class the Lightning Type references — not invented. The Lightning Type root points at the **outer Apex class** (`@apexClassType/<namespace>__<ClassName>`); that outer class's `@AuraEnabled` fields define the payload shape. Inner classes appear only as nested list-element types (e.g. `List<OpenOpportunity>` on the outer class) and are referenced by their `List<...>` fields, not by a separate FQN. This file documents the derivation rule.
|
|
4
|
+
|
|
5
|
+
> **Scope:** This guide covers Apex-backed Lightning Types only. The orchestrator (`platform-lightning-type-widget-coordinate`) only routes Apex-backed types into this skill. Object/JSON-based Lightning Types (Lightning Type root `lightning:type: "lightning__objectType"` with primitive `properties`) are out of scope here.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Guidance
|
|
10
|
+
|
|
11
|
+
- The widget aligns to the Lightning Type's shape — it grounds on the `@AuraEnabled` fields of the Apex class the type references.
|
|
12
|
+
- The widget MUST NOT introduce properties the Apex class does not expose.
|
|
13
|
+
- **Default to including every `@AuraEnabled` field.** Omission is the exception, not the rule. Before dropping any field, confirm with the user — print the field, its Apex type, and the omission rationale (e.g. "audit timestamp, not user-facing"), and ASK before continuing. Silent omission is a hard violation; the orchestrator's P1.1 gate flags it.
|
|
14
|
+
- Fields that are typically safe to propose for omission *with user confirmation*: audit timestamps (`createdDate`, `lastModifiedDate`), system IDs that duplicate a primary key, and internal flags. **Domain-meaningful fields — including `List<InnerClass>` collections — are NEVER omitted silently.**
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Deriving from an Apex-backed Lightning Type
|
|
19
|
+
|
|
20
|
+
The Lightning Type root is minimal and points at the **outer Apex class**:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"title": "<TypeName>",
|
|
25
|
+
"lightning:type": "@apexClassType/<namespace>__<ClassName>"
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The widget cannot mirror this directly — the widget root is a plain `type: "object"` whose `properties.attributes` wrapper carries `lightning:type: "lightning__objectType"` and the actual field map. Derive the widget shape from the Apex class's `@AuraEnabled` fields:
|
|
30
|
+
|
|
31
|
+
1. Read the Apex class file (path provided by the orchestrator's Phase 4 output, or located via `<pkgDir>/classes/<ClassName>.cls`). The `apexClassFqn` from the orchestrator names the outer class.
|
|
32
|
+
2. **Enumerate every `@AuraEnabled` field on the outer class AND every field on each inner class referenced by a `List<Inner>` field.** Default disposition is **include**. If you propose to drop any field, ASK the user first and record the rationale in the build plan's `Properties omitted:` section. Do not silently drop.
|
|
33
|
+
3. For each retained field, map the Apex type to the matching `lightning:type`:
|
|
34
|
+
|
|
35
|
+
| Apex type | `lightning:type` (in widget schema) |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `String`, `Id` | `lightning__textType` |
|
|
38
|
+
| `Decimal`, `Double`, `Integer`, `Long` | `lightning__numberType` |
|
|
39
|
+
| `Boolean` | `lightning__booleanType` |
|
|
40
|
+
| `Date`, `Datetime` | `lightning__dateTimeType` |
|
|
41
|
+
| `List<Primitive>` (e.g. `List<String>`) | `lightning__listType` |
|
|
42
|
+
| `List<InnerClass>` | `lightning__listType` — and the widget body MUST iterate this list with `forEach`/`forItem` and bind every `@AuraEnabled` field on `InnerClass` via `{!$item.<innerField>}`. See `references/widget-meta-directives.md`. |
|
|
43
|
+
|
|
44
|
+
4. Build the widget `schema.json`. **Every `@AuraEnabled` field on the outer class** that survived step 2 MUST appear as an entry under `properties.attributes.properties`. Inner-class fields are NOT separate entries — they are accessed via the loop variable inside `forEach`, so they do not need their own entry in the widget schema.
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"title": "<WidgetDisplayName>",
|
|
49
|
+
"description": "<one line about what the widget renders>",
|
|
50
|
+
"type": "object",
|
|
51
|
+
"properties": {
|
|
52
|
+
"attributes": {
|
|
53
|
+
"lightning:type": "lightning__objectType",
|
|
54
|
+
"properties": {
|
|
55
|
+
"<textFieldName>": { "title": "<Text Field Label>", "lightning:type": "lightning__textType" },
|
|
56
|
+
"<numberFieldName>": { "title": "<Number Field Label>", "lightning:type": "lightning__numberType" },
|
|
57
|
+
"<dateTimeFieldName>": { "title": "<Date/Time Field Label>", "lightning:type": "lightning__dateTimeType" },
|
|
58
|
+
"<listFieldName>": { "title": "<List Field Label>", "lightning:type": "lightning__listType" }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Reachability check
|
|
68
|
+
|
|
69
|
+
Before authoring the widget body, confirm every property you plan to bind via `{!$attrs.X}` exists in the derived widget `schema.json`. The orchestrator's P0.4 gate enforces this; the leaf skill must self-check first to avoid round-trips.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Out of scope
|
|
74
|
+
|
|
75
|
+
- Renaming Apex class fields for display. The widget schema must use the same names as the Apex class. Display labels are carried in `title` only.
|
|
76
|
+
- Synthesizing properties not present on the resolved payload class. This includes computed/derived fields and any field the Apex class does not currently expose. **`platform-widget-generate` MUST NOT edit `.cls` files.** If the widget body needs a field that is missing (for example, a `lightning__booleanType` to drive `meta.if`), STOP and surface the gap to the orchestrator — name the missing field, its expected type, and why the widget needs it. The orchestrator decides whether to amend the Apex class (via `platform-apex-generate`) or revise the widget plan.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# WidgetBundle Layout
|
|
2
|
+
|
|
3
|
+
The widget skill writes three files into one directory under the project's package directory.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Folder layout
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
<pkgDir>/uiWidgets/<widgetName>/
|
|
11
|
+
<widgetName>.json # widget envelope + UEM body
|
|
12
|
+
schema.json # JSON Schema
|
|
13
|
+
<widgetName>.uiwidget-meta.xml # UiWidgetBundle registration
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`<widgetName>` is `camelCase` and matches the directory name and both `<widgetName>.json` / `<widgetName>.uiwidget-meta.xml` filenames exactly.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Resolving `<pkgDir>`
|
|
21
|
+
|
|
22
|
+
`<pkgDir>` resolves to `<packageDirectories[].path>/main/default` — the SFDX source-format default, where `<packageDirectories[].path>` is the `default: true` entry in `sfdx-project.json` (or the first entry if none is marked default).
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## `<widgetName>.json` — Widget envelope + UEM body
|
|
27
|
+
|
|
28
|
+
The envelope has exactly two top-level keys — `type` and `contentBody`. The UEM tree lives at `contentBody.widgetBody`. Display metadata (label / description) lives in `<widgetName>.uiwidget-meta.xml`, not in the envelope.
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"type": "lightning__agentforceWidget",
|
|
33
|
+
"contentBody": {
|
|
34
|
+
"widgetBody": {
|
|
35
|
+
"definition": "tile/widget",
|
|
36
|
+
"children": [
|
|
37
|
+
/* every block — root and non-root — carries "definition", optional "attributes", optional "meta", optional "children". No "type" key on any node. */
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Envelope keys:
|
|
45
|
+
|
|
46
|
+
- `type` — always `"lightning__agentforceWidget"`.
|
|
47
|
+
- `contentBody.widgetBody` — the root UEM node; this is `tile/widget`. It carries `definition` and `children` only — no `type` key on the root, no `type` key on any child.
|
|
48
|
+
|
|
49
|
+
Tree composition (everything inside `widgetBody.children`) is owned by `SKILL.md` *Composition*. No node — root or non-root — carries a `type` key.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## `schema.json` — Input contract
|
|
54
|
+
|
|
55
|
+
JSON Schema describing what data the widget accepts at runtime. Fields are wrapped one level deep under `properties.attributes`.
|
|
56
|
+
|
|
57
|
+
**Required root keys:**
|
|
58
|
+
|
|
59
|
+
- `title` (string) — display name
|
|
60
|
+
- `type` (string) — must equal `"object"`
|
|
61
|
+
- `properties.attributes` (object) — must carry `lightning:type: "lightning__objectType"` and a nested `properties` map whose leaves each carry `lightning:type`
|
|
62
|
+
|
|
63
|
+
**Optional root keys:**
|
|
64
|
+
|
|
65
|
+
- `description` (string)
|
|
66
|
+
|
|
67
|
+
**Each leaf under `properties.attributes.properties` MUST have `lightning:type`.** Optional per-leaf: `title`, `description`.
|
|
68
|
+
|
|
69
|
+
Example:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"title": "Order Summary Widget",
|
|
74
|
+
"description": "Displays an order's id, customer, and total.",
|
|
75
|
+
"type": "object",
|
|
76
|
+
"properties": {
|
|
77
|
+
"attributes": {
|
|
78
|
+
"lightning:type": "lightning__objectType",
|
|
79
|
+
"properties": {
|
|
80
|
+
"orderId": { "title": "Order ID", "description": "Stable identifier shown in the header.", "lightning:type": "lightning__textType" },
|
|
81
|
+
"customer": { "title": "Customer", "description": "Display name of the customer on the order.", "lightning:type": "lightning__textType" },
|
|
82
|
+
"total": { "title": "Total", "description": "Order total in the order's currency.", "lightning:type": "lightning__numberType" }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`{!$attrs.X}` in the body resolves to `properties.attributes.properties.X` in the schema.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## `<widgetName>.uiwidget-meta.xml` — Registration
|
|
94
|
+
|
|
95
|
+
```xml
|
|
96
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
97
|
+
<UiWidgetBundle xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
98
|
+
<masterLabel><Human display label></masterLabel>
|
|
99
|
+
<description><One-line description of what the widget renders></description>
|
|
100
|
+
<widgetType>JSON</widgetType>
|
|
101
|
+
</UiWidgetBundle>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Elements:
|
|
105
|
+
|
|
106
|
+
- `<masterLabel>` — required. Human-readable label shown in the runtime UI. Prefer title-case (e.g. `Account Summary Card`) — not the `camelCase` `<widgetName>`.
|
|
107
|
+
- `<description>` — required. One-line description of what the widget renders. Populates the display metadata previously carried in the envelope.
|
|
108
|
+
- `<widgetType>` — required. Only the `JSON` variant is supported. The `FUNCTION` variant is out of scope.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Validation reminders
|
|
113
|
+
|
|
114
|
+
- Every `{!$attrs.X}` in `<widgetName>.json` MUST resolve to a property under `schema.json` `properties.attributes.properties` (or to a `forItem` loop variable defined upstream).
|
|
115
|
+
- `<widgetName>.uiwidget-meta.xml` MUST parse as well-formed XML, have root element `<UiWidgetBundle>`, and carry non-empty `<masterLabel>`, `<description>`, and `<widgetType>JSON</widgetType>` elements.
|
|
116
|
+
- The three files MUST be co-located in the same `<widgetName>/` directory under `uiWidgets/`.
|