@salesforce/afv-skills 1.7.2 → 1.7.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/afv-skills",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "Salesforce skills for Agentforce Vibes",
5
5
  "license": "CC-BY-NC-4.0",
6
6
  "files": [
@@ -20,6 +20,7 @@ Use this skill when you need to:
20
20
  Custom Lightning Types (CLTs) are JSON Schema-based type definitions used by the Lightning Platform (including Einstein Agent actions) to describe structured inputs/outputs and drive editor/renderer experiences.
21
21
 
22
22
  ## Configuration
23
+ - **Choose referenced CLT pattern for nested objects** - When you need a **reusable** or **separately deployed** nested type, create a CLT for that shape and reference it with `"lightning:type": "c__<CLTName>"`. That string is the referenced type’s **`lightning:type` value / FQN / registered identifier** — not the JSON Schema `title`.
23
24
  - **Choose standard Lightning types** when the structure is simple and can be expressed with properties and supported primitive `lightning:type` identifiers.
24
25
  - **Choose Apex class types** (`@apexClassType/...`) when the structure already exists server-side and you want the Apex class to define the shape.
25
26
  - **Include editor/renderer config** only when you need custom UI behavior (custom LWC input/output components). Otherwise, omit.
@@ -33,7 +34,7 @@ Custom Lightning Types (CLTs) are JSON Schema-based type definitions used by the
33
34
  - `"unevaluatedProperties"` is enforced as `false` by the CLT metaschema. Do not set it to `true`.
34
35
  - **Root object schemas MUST NOT include** `"examples"` when `"unevaluatedProperties": false` is set.
35
36
  - **Nested objects (inside `properties`) MUST NOT set** `"lightning:type": "lightning__objectType"`.
36
- - Nested objects should be plain JSON Schema objects (`type`, `properties`, optional `required`, optional `unevaluatedProperties`).
37
+ - Nested objects can be: references to other CLTs using `c__<CLTName>` syntax.
37
38
  - **List/array properties are highly restricted by the CLT metaschema**:
38
39
  - **CRITICAL LIMITATION**: the CLT metaschema may reject the `items` keyword entirely. Treat `items` as **disallowed by default**.
39
40
  - **Root-level arrays** (direct children of the root `properties`):
@@ -96,8 +97,13 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
96
97
  2. **Draft `schema.json`**
97
98
  - Start with the root object structure (required root fields).
98
99
  - Add `properties` using valid primitive `lightning:type` identifiers.
99
- - For nested objects: omit `lightning:type` and keep keywords minimal.
100
+ - For nested-object properties, use **CLT Reference pattern**:
101
+ - `"lightning:type": "c__<CLTName>"` to reference another CLT
102
+ - The referenced CLT must be deployed to the org before the parent CLT.
103
+ - For Apex-based nested objects: Use `@apexClassType/...` when structure exists server-side.
104
+ - If the prompt explicitly requires true nested object output, prefer an **Apex-based CLT** (`@apexClassType/...`) for deploy-safe nested structures.
100
105
  - For arrays: follow the strict list rules (avoid `items`; avoid `lightning:type` on nested arrays).
106
+ - Before deployment, verify exact `lightning:type` spellings (for example, use `lightning__richTextType`, not misspelled variants).
101
107
  3. **(Optional) Draft `editor.json`** (only if custom UI is required)
102
108
  - **Supported shape:** Top-level `editor` object with `editor.componentOverrides` and `editor.layout`.
103
109
  - Top-level `editor` object.
@@ -159,6 +165,7 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
159
165
  </LightningComponentBundle>
160
166
  ```
161
167
  7. **Deploy and validate**
168
+ - Run a final schema sanity check before deploy: valid `lightning:type` names, required fields present, and no disallowed keywords.
162
169
  - Deploy the bundle using your org's standard metadata deployment flow (e.g. Salesforce CLI or IDE). The MCP client or tooling in use should provide or integrate with the appropriate deploy/retrieve commands for Lightning Type bundles.
163
170
  - Validate incrementally: if deployment fails, remove disallowed keywords first (especially `examples`, `items`, nested `lightning:type`).
164
171
 
@@ -166,7 +173,9 @@ When strict validation is enabled (`unevaluatedProperties: false`), keep each pr
166
173
  | Error / Symptom | Likely Cause | Fix |
167
174
  |---|---|---|
168
175
  | Schema validation fails due to unknown keyword | `unevaluatedProperties: false` + disallowed keyword (commonly `examples`, `items`) | Remove the offending keyword; keep schema minimal |
169
- | Nested object validation failure | Nested object includes `lightning:type: lightning__objectType` | Remove `lightning:type` from nested objects |
176
+ | Nested object validation failure | Org/channel validation rejects nested object typing in `LightningTypeBundle` | Use CLT reference (`c__<CLTName>`) or Apex class types |
177
+ | Invalid CLT reference | Referenced CLT doesn't exist in org or incorrect syntax | Deploy the referenced CLT first; `c__<CLTName>` must match the referenced type’s **`lightning:type` value / FQN / registered identifier**, not `title` |
178
+ | Invalid or misspelled `lightning:type` (for example, `lightning__richtextType` instead of `lightning__richTextType`) | Incorrect generated type name | Cross-check all `lightning:type` values against supported type names and correct them before deployment |
170
179
  | Array property rejected | Use of `items` (or `lightning:type` in nested arrays) rejected by validator | For nested arrays: keep only `type: "array"`. For root arrays: use minimal structure; remove `items` if rejected |
171
180
  | Apex-based CLT rejected | Extra fields added (e.g., `type`, `properties`) | Use only `title`, optional `description`, and `lightning:type` |
172
181
  | Editor config rejected | Use of invalid patterns (`es_property_editors/inputList`, `itemSchema`) or unrecognized top-level keys | Use `editor.componentOverrides` and `editor.layout`; keep config minimal |