Skip to content

Commit 3510ff8

Browse files
perf(dev): add table block to minimal registry; doc block registration in registry-maps
Adds the Table block to the SIM_DEV_MINIMAL_REGISTRY curated set so the tables surface works under dev:minimal. Updates the integration skills/rules and CLAUDE.md to point block registration at blocks/registry-maps.ts (the BLOCK_REGISTRY / BLOCK_META_REGISTRY maps), reflecting that registry.ts now holds only the accessor functions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent cdd5a0f commit 3510ff8

10 files changed

Lines changed: 53 additions & 29 deletions

File tree

.claude/commands/add-block.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -600,17 +600,20 @@ export const ServiceV2Block: BlockConfig = {
600600

601601
## Registering Blocks
602602

603-
After creating the block, remind the user to:
604-
1. Import in `apps/sim/blocks/registry.ts`
605-
2. Add to the `registry` object (alphabetically):
603+
After creating the block, remind the user to register it in `apps/sim/blocks/registry-maps.ts` (the data maps live here; `registry.ts` holds only the accessor functions). Add the import and an entry to each map alphabetically:
606604

607605
```typescript
608-
import { ServiceBlock } from '@/blocks/blocks/service'
606+
import { ServiceBlock, ServiceBlockMeta } from '@/blocks/blocks/service'
609607

610-
export const registry: Record<string, BlockConfig> = {
608+
export const BLOCK_REGISTRY: Record<string, BlockConfig> = {
611609
// ... existing blocks ...
612610
service: ServiceBlock,
613611
}
612+
613+
export const BLOCK_META_REGISTRY: Record<string, BlockMeta> = {
614+
// ... existing metas ...
615+
service: ServiceBlockMeta,
616+
}
614617
```
615618

616619
## Complete Example
@@ -840,7 +843,7 @@ Derive templates from the service's real use cases. Each prompt should name a co
840843
- [ ] Tools.access lists all tool IDs (snake_case)
841844
- [ ] Tools.config.tool returns correct tool ID (snake_case)
842845
- [ ] Outputs match tool outputs
843-
- [ ] Block registered in registry.ts
846+
- [ ] Block + meta registered in registry-maps.ts (`BLOCK_REGISTRY` / `BLOCK_META_REGISTRY`)
844847
- [ ] If icon missing: asked user to provide SVG
845848
- [ ] If triggers exist: `triggers` config set, trigger subBlocks spread
846849
- [ ] Optional/rarely-used fields set to `mode: 'advanced'`

.claude/commands/add-integration.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,17 +364,25 @@ export const tools: Record<string, ToolConfig> = {
364364
}
365365
```
366366

367-
### Block Registry (`apps/sim/blocks/registry.ts`)
367+
### Block Registry (`apps/sim/blocks/registry-maps.ts`)
368+
369+
The data maps (`BLOCK_REGISTRY` + `BLOCK_META_REGISTRY`) live in `registry-maps.ts`; `registry.ts` holds only the accessor functions. Add the import and an entry to each map alphabetically:
368370

369371
```typescript
370372
// Add import (alphabetically)
371-
import { {Service}Block } from '@/blocks/blocks/{service}'
373+
import { {Service}Block, {Service}BlockMeta } from '@/blocks/blocks/{service}'
372374

373-
// Add to registry (alphabetically)
374-
export const registry: Record<string, BlockConfig> = {
375+
// Add to the config map (alphabetically)
376+
export const BLOCK_REGISTRY: Record<string, BlockConfig> = {
375377
// ... existing blocks ...
376378
{service}: {Service}Block,
377379
}
380+
381+
// Add to the catalog-meta map (alphabetically)
382+
export const BLOCK_META_REGISTRY: Record<string, BlockMeta> = {
383+
// ... existing metas ...
384+
{service}: {Service}BlockMeta,
385+
}
378386
```
379387

380388
### Trigger Registry (`apps/sim/triggers/registry.ts`) - If triggers exist
@@ -443,7 +451,7 @@ If creating V2 versions (API-aligned outputs):
443451
- [ ] Configured tools.access with all tool IDs
444452
- [ ] Configured tools.config.tool selector
445453
- [ ] Defined outputs matching tool outputs
446-
- [ ] Registered block in `blocks/registry.ts`
454+
- [ ] Registered block + meta in `blocks/registry-maps.ts` (`BLOCK_REGISTRY` / `BLOCK_META_REGISTRY`)
447455
- [ ] If triggers: set `triggers.enabled` and `triggers.available`
448456
- [ ] If triggers: spread trigger subBlocks with `getTrigger()`
449457
- [ ] Exported `{Service}BlockMeta` with at least 7 templates

.claude/commands/validate-integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Read **every** file for the integration — do not skip any:
2424
apps/sim/tools/{service}/ # All tool files, types.ts, index.ts
2525
apps/sim/blocks/blocks/{service}.ts # Block definition
2626
apps/sim/tools/registry.ts # Tool registry entries for this service
27-
apps/sim/blocks/registry.ts # Block registry entry for this service
27+
apps/sim/blocks/registry-maps.ts # Block + meta registry entry (BLOCK_REGISTRY / BLOCK_META_REGISTRY)
2828
apps/sim/components/icons.tsx # Icon definition
2929
apps/sim/lib/auth/auth.ts # OAuth config — should use getCanonicalScopesForProvider()
3030
apps/sim/lib/oauth/oauth.ts # OAuth provider config — single source of truth for scopes
@@ -190,7 +190,7 @@ For **each tool** in `tools.access`:
190190
- [ ] `bgColor` uses the service's brand color hex
191191
- [ ] `icon` references the correct icon component from `@/components/icons`
192192
- [ ] `authMode` is set correctly (`AuthMode.OAuth` or `AuthMode.ApiKey`)
193-
- [ ] Block is registered in `blocks/registry.ts` alphabetically
193+
- [ ] Block + meta are registered in `blocks/registry-maps.ts` (`BLOCK_REGISTRY` / `BLOCK_META_REGISTRY`) alphabetically
194194

195195
### BlockMeta
196196
- [ ] `{Service}BlockMeta` is exported in the same file as the block

.claude/rules/sim-integrations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The full authoring instructions — tool/block/icon/trigger scaffolding, SubBloc
1313

1414
## Hard rules (don't get these wrong)
1515

16-
- Tool IDs are `snake_case` (`service_action`). Register tools in `tools/registry.ts`, blocks in `blocks/registry.ts` (alphabetically), triggers in `triggers/registry.ts`.
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`.
1717
- 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).
1818
- `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.
1919
- 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.

.cursor/commands/add-block.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,17 +608,20 @@ export const ServiceV2Block: BlockConfig = {
608608

609609
## Registering Blocks
610610

611-
After creating the block, remind the user to:
612-
1. Import in `apps/sim/blocks/registry.ts`
613-
2. Add to the `registry` object (alphabetically):
611+
After creating the block, remind the user to register it in `apps/sim/blocks/registry-maps.ts` (the data maps live here; `registry.ts` holds only the accessor functions). Add the import and an entry to each map alphabetically:
614612

615613
```typescript
616-
import { ServiceBlock } from '@/blocks/blocks/service'
614+
import { ServiceBlock, ServiceBlockMeta } from '@/blocks/blocks/service'
617615

618-
export const registry: Record<string, BlockConfig> = {
616+
export const BLOCK_REGISTRY: Record<string, BlockConfig> = {
619617
// ... existing blocks ...
620618
service: ServiceBlock,
621619
}
620+
621+
export const BLOCK_META_REGISTRY: Record<string, BlockMeta> = {
622+
// ... existing metas ...
623+
service: ServiceBlockMeta,
624+
}
622625
```
623626

624627
## Complete Example
@@ -847,7 +850,7 @@ Derive templates from the service's real use cases. Each prompt should name a co
847850
- [ ] Tools.access lists all tool IDs (snake_case)
848851
- [ ] Tools.config.tool returns correct tool ID (snake_case)
849852
- [ ] Outputs match tool outputs
850-
- [ ] Block registered in registry.ts
853+
- [ ] Block + meta registered in registry-maps.ts (`BLOCK_REGISTRY` / `BLOCK_META_REGISTRY`)
851854
- [ ] If icon missing: asked user to provide SVG
852855
- [ ] If triggers exist: `triggers` config set, trigger subBlocks spread
853856
- [ ] Optional/rarely-used fields set to `mode: 'advanced'`

.cursor/commands/add-integration.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,17 +337,25 @@ export const tools: Record<string, ToolConfig> = {
337337
}
338338
```
339339

340-
### Block Registry (`apps/sim/blocks/registry.ts`)
340+
### Block Registry (`apps/sim/blocks/registry-maps.ts`)
341+
342+
The data maps (`BLOCK_REGISTRY` + `BLOCK_META_REGISTRY`) live in `registry-maps.ts`; `registry.ts` holds only the accessor functions. Add the import and an entry to each map alphabetically:
341343

342344
```typescript
343345
// Add import (alphabetically)
344-
import { {Service}Block } from '@/blocks/blocks/{service}'
346+
import { {Service}Block, {Service}BlockMeta } from '@/blocks/blocks/{service}'
345347

346-
// Add to registry (alphabetically)
347-
export const registry: Record<string, BlockConfig> = {
348+
// Add to the config map (alphabetically)
349+
export const BLOCK_REGISTRY: Record<string, BlockConfig> = {
348350
// ... existing blocks ...
349351
{service}: {Service}Block,
350352
}
353+
354+
// Add to the catalog-meta map (alphabetically)
355+
export const BLOCK_META_REGISTRY: Record<string, BlockMeta> = {
356+
// ... existing metas ...
357+
{service}: {Service}BlockMeta,
358+
}
351359
```
352360

353361
### Trigger Registry (`apps/sim/triggers/registry.ts`) - If triggers exist
@@ -416,7 +424,7 @@ If creating V2 versions (API-aligned outputs):
416424
- [ ] Configured tools.access with all tool IDs
417425
- [ ] Configured tools.config.tool selector
418426
- [ ] Defined outputs matching tool outputs
419-
- [ ] Registered block in `blocks/registry.ts`
427+
- [ ] Registered block + meta in `blocks/registry-maps.ts` (`BLOCK_REGISTRY` / `BLOCK_META_REGISTRY`)
420428
- [ ] If triggers: set `triggers.enabled` and `triggers.available`
421429
- [ ] If triggers: spread trigger subBlocks with `getTrigger()`
422430

.cursor/commands/validate-integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Read **every** file for the integration — do not skip any:
1919
apps/sim/tools/{service}/ # All tool files, types.ts, index.ts
2020
apps/sim/blocks/blocks/{service}.ts # Block definition
2121
apps/sim/tools/registry.ts # Tool registry entries for this service
22-
apps/sim/blocks/registry.ts # Block registry entry for this service
22+
apps/sim/blocks/registry-maps.ts # Block + meta registry entry (BLOCK_REGISTRY / BLOCK_META_REGISTRY)
2323
apps/sim/components/icons.tsx # Icon definition
2424
apps/sim/lib/auth/auth.ts # OAuth config — should use getCanonicalScopesForProvider()
2525
apps/sim/lib/oauth/oauth.ts # OAuth provider config — single source of truth for scopes
@@ -185,7 +185,7 @@ For **each tool** in `tools.access`:
185185
- [ ] `bgColor` uses the service's brand color hex
186186
- [ ] `icon` references the correct icon component from `@/components/icons`
187187
- [ ] `authMode` is set correctly (`AuthMode.OAuth` or `AuthMode.ApiKey`)
188-
- [ ] Block is registered in `blocks/registry.ts` alphabetically
188+
- [ ] Block + meta are registered in `blocks/registry-maps.ts` (`BLOCK_REGISTRY` / `BLOCK_META_REGISTRY`) alphabetically
189189

190190
### BlockMeta
191191
- [ ] `{Service}BlockMeta` is exported in the same file as the block

.cursor/rules/sim-integrations.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The full authoring instructions — tool/block/icon/trigger scaffolding, SubBloc
1010

1111
## Hard rules (don't get these wrong)
1212

13-
- Tool IDs are `snake_case` (`service_action`). Register tools in `tools/registry.ts`, blocks in `blocks/registry.ts` (alphabetically), triggers in `triggers/registry.ts`.
13+
- 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`.
1414
- 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).
1515
- `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.
1616
- 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.

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ New integrations are built in order: **Tools** → **Block** → **Icon** → (o
469469

470470
Two hard rules that the skills assume:
471471

472-
- **Tool IDs are `snake_case`** (`service_action`) and must be registered in `tools/registry.ts`; blocks register in `blocks/registry.ts` (alphabetically).
472+
- **Tool IDs are `snake_case`** (`service_action`) and must be registered in `tools/registry.ts`; blocks register in `blocks/registry-maps.ts` — the `BLOCK_REGISTRY` config map and `BLOCK_META_REGISTRY` catalog-meta map (alphabetically). `blocks/registry.ts` holds only the accessor functions (`getBlock`, `getAllBlocks`, …).
473473
- **`tools.config.tool` runs during serialization (before variable resolution)** — never do `Number()` or other type coercions there, or dynamic references like `<Block.output>` are destroyed. Put all type coercions in `tools.config.params`, which runs during execution after variables resolve.
474474

475475
For the full authoring instructions — SubBlock property tables, `condition`/`dependsOn`/`required`/`mode`/`canonicalParamId` syntax, required block metadata (`integrationType`, `tags`, `authMode`, `docsLink`, `{Service}BlockMeta`), file-input/`normalizeFileInput` patterns, and checklists — use the skills: `/add-integration` (end-to-end), `/add-tools`, `/add-block`, `/add-trigger`.

apps/sim/blocks/registry-maps.minimal.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { RouterBlock } from '@/blocks/blocks/router'
1616
import { ScheduleBlock } from '@/blocks/blocks/schedule'
1717
import { StartTriggerBlock } from '@/blocks/blocks/start_trigger'
1818
import { StarterBlock } from '@/blocks/blocks/starter'
19+
import { TableBlock } from '@/blocks/blocks/table'
1920
import { VariablesBlock } from '@/blocks/blocks/variables'
2021
import { WorkflowBlock } from '@/blocks/blocks/workflow'
2122
import type { BlockConfig, BlockMeta } from '@/blocks/types'
@@ -46,6 +47,7 @@ export const BLOCK_REGISTRY: Record<string, BlockConfig> = {
4647
schedule: ScheduleBlock,
4748
start_trigger: StartTriggerBlock,
4849
starter: StarterBlock,
50+
table: TableBlock,
4951
variables: VariablesBlock,
5052
workflow: WorkflowBlock,
5153
}

0 commit comments

Comments
 (0)