You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note neither subblock `id` is `channel` — the canonical id is a third name that both members map
232
+
onto, and it is the only one that survives serialization.
233
+
231
234
**Critical Canonical Param Rules:**
232
235
-`canonicalParamId` must NOT match any subblock's `id` in the block
233
-
-`canonicalParamId` must be unique per operation/condition context
234
-
- Only use `canonicalParamId` to link basic/advanced alternatives for the same logical parameter
236
+
-`canonicalParamId` must be unique **block-wide**, not per operation. `buildCanonicalIndex` keys
237
+
groups by `canonicalParamId` across all subblocks and a group holds exactly one `basicId`, so two
238
+
operations that each need their own pair must use two different canonical ids
239
+
- Only use `canonicalParamId` to link basic/advanced alternatives for the same logical parameter.
240
+
A pair carries ONE concept — for files that means upload (basic) + file reference (advanced), as
241
+
in Gmail attachments (`blocks/blocks/gmail.ts`). Never overload the advanced side with alternate
242
+
identifiers like a URL or a provider asset ID; give those their own subblocks, mark all the
243
+
mutually exclusive sources `required: false`, and enforce "exactly one" at execution
235
244
-`mode` only controls UI visibility, NOT serialization. Without `canonicalParamId`, both basic and advanced field values would be sent
236
245
- Every subblock `id` must be unique within the block. Duplicate IDs cause conflicts even with different conditions
237
246
-**Required consistency:** If one subblock in a canonical group has `required: true`, ALL subblocks in that group must have `required: true` (prevents bypassing validation by switching modes)
Note neither subblock `id` is `channel` — the canonical id is a third name that both members map
231
+
onto, and it is the only one that survives serialization.
232
+
230
233
**Critical Canonical Param Rules:**
231
234
-`canonicalParamId` must NOT match any subblock's `id` in the block
232
-
-`canonicalParamId` must be unique per operation/condition context
233
-
- Only use `canonicalParamId` to link basic/advanced alternatives for the same logical parameter
235
+
-`canonicalParamId` must be unique **block-wide**, not per operation. `buildCanonicalIndex` keys
236
+
groups by `canonicalParamId` across all subblocks and a group holds exactly one `basicId`, so two
237
+
operations that each need their own pair must use two different canonical ids
238
+
- Only use `canonicalParamId` to link basic/advanced alternatives for the same logical parameter.
239
+
A pair carries ONE concept — for files that means upload (basic) + file reference (advanced), as
240
+
in Gmail attachments (`blocks/blocks/gmail.ts`). Never overload the advanced side with alternate
241
+
identifiers like a URL or a provider asset ID; give those their own subblocks, mark all the
242
+
mutually exclusive sources `required: false`, and enforce "exactly one" at execution
234
243
-`mode` only controls UI visibility, NOT serialization. Without `canonicalParamId`, both basic and advanced field values would be sent
235
244
- Every subblock `id` must be unique within the block. Duplicate IDs cause conflicts even with different conditions
236
245
-**Required consistency:** If one subblock in a canonical group has `required: true`, ALL subblocks in that group must have `required: true` (prevents bypassing validation by switching modes)
Copy file name to clipboardExpand all lines: .claude/rules/sim-integrations.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,5 +15,6 @@ The full authoring instructions — tool/block/icon/trigger scaffolding, SubBloc
15
15
16
16
- Tool IDs are `snake_case` (`service_action`). Register tools in `tools/registry.ts`, blocks in `blocks/registry-maps.ts` (the `BLOCK_REGISTRY` config map + `BLOCK_META_REGISTRY` catalog-meta map, alphabetically — `blocks/registry.ts` holds only the accessor functions), triggers in `triggers/registry.ts`.
17
17
- Type coercions (`Number()`, etc.) belong in `tools.config.params` (runs at execution, after variable resolution) — never in `tools.config.tool` (runs at serialization; coercing there destroys dynamic `<Block.output>` references).
18
-
-`canonicalParamId` must NOT match any subblock's `id`, must be unique per operation/condition context, and all subblocks in a canonical group must share the same `required` status. The `inputs` section and the params function reference canonical IDs, not raw subblock IDs.
18
+
-`canonicalParamId` must NOT match any subblock's `id`, must be unique **block-wide** (groups are keyed by canonical id across every subblock and hold exactly one `basicId`, so two operations that each need a pair need two different canonical ids), and all subblocks in a canonical group must share the same `required` status. The `inputs` section and the params function reference canonical IDs, not raw subblock IDs — the serializer deletes the subblock IDs and republishes the active member's value under the canonical ID.
19
+
- A canonical pair carries ONE concept. For files that is upload (basic) + file reference (advanced), as in Gmail attachments (`blocks/blocks/gmail.ts`). Never overload the advanced side with alternate identifiers (URL, provider asset ID) — give those their own subblocks, mark mutually exclusive sources `required: false`, and enforce "exactly one" at execution.
19
20
- Blocks must also set the catalog/UI metadata fields `integrationType`, `tags`, `authMode`, `docsLink`, and export a `{Service}BlockMeta` — see the `/add-block` skill's BlockMeta section for details.
0 commit comments