Skip to content

Commit cc4ca66

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
Merge remote-tracking branch 'origin/staging' into fix/tiktok-webhook-routing
# Conflicts: # packages/db/migrations/meta/0282_snapshot.json # packages/db/migrations/meta/_journal.json
2 parents 8d40ee4 + a477a52 commit cc4ca66

2,184 files changed

Lines changed: 242034 additions & 24686 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/add-block/SKILL.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,32 @@ export const {ServiceName}Block: BlockConfig = {
163163

164164
Optional companions: `credentialLabels` (override the picker's section/connect-row copy) and `allowServiceAccounts: true` (trigger-mode only — list service accounts, which triggers otherwise exclude; set only when the trigger's polling path can resolve a service-account token). The connect modal, provider families (Google JSON key, Atlassian token, token-paste, client-credential, Slack bot), and the preview gate are all resolved from `serviceAccountProviderId` — you don't wire them per block.
165165

166+
### OAuth deployment availability (required for integration blocks)
167+
168+
A visible tools-category block with OAuth is deployment-gated. Its `oauth-input.serviceId` is
169+
projected into `apps/sim/lib/integrations/integrations.json`, then resolved through
170+
`resolveOAuthClientCapabilityId()` in `apps/sim/lib/core/config/env-capabilities.ts`.
171+
172+
When adding or changing an OAuth integration block:
173+
174+
1. Keep exactly one distinct OAuth `serviceId` across the block's `oauth-input` subBlocks.
175+
2. Confirm that service ID resolves to an entry in `OAUTH_CLIENT_CAPABILITIES`. Google and
176+
Microsoft service IDs intentionally share their provider-level capability; do not add duplicate
177+
entries for those aliases.
178+
3. For a new capability, add its required client fields to `OAUTH_CLIENT_CAPABILITIES` and ensure
179+
every referenced field exists in the env schema in `apps/sim/lib/core/config/env.ts`. Then add
180+
the matching `text` or `secret` input modes to `OAUTH_CLIENT_SETUP_FIELDS` in
181+
`scripts/setup/capability-config.ts`. The CLI catalog is exhaustively typed and checked against
182+
the runtime field list; do not infer secrecy from the field name.
183+
4. If the canonical OAuth service declares `serviceAccountProviderId`, keep
184+
`SERVICE_ACCOUNT_METADATA_BY_OAUTH_SERVICE_ID` in
185+
`apps/sim/lib/integrations/service-account-metadata.ts` aligned. Set
186+
`deploymentRequirement` only when the service-account path is preview-gated or depends on the
187+
OAuth client fields; otherwise omit it.
188+
189+
Missing capability metadata is a runtime configuration error, not a reason to make the integration
190+
silently available.
191+
166192
### Selectors (with dynamic options)
167193
```typescript
168194
// Channel selector (Slack, Discord, etc.)
@@ -919,12 +945,25 @@ Derive templates from the service's real use cases. Each prompt should name a co
919945
- **Ground every skill in operations the block actually exposes** — cross-check each skill's steps against `tools.access`. Never describe an action the integration cannot perform.
920946
- **Derive skills from real, popular use cases found online — never invent them.** Web-search the service's documented use cases (vendor use-case/solutions pages, official docs describing the workflow, reputable "top automations for X" articles) and only add a skill you can source as something people genuinely do with the service. Do not hallucinate skills.
921947

922-
## Generated tool metadata
948+
## Generated artifacts
923949

924-
Adding a block on its own needs **no** regeneration — a block references existing tool IDs through `tools.access` and does not change any tool's shape.
950+
Adding a block on its own needs no **tool metadata** regeneration — a block references existing
951+
tool IDs through `tools.access` and does not change any tool's shape.
925952

926953
But if the same change also adds, edits **or removes** a tool, run `bun run tool-metadata:generate` and commit the result, or CI fails on stale artifacts. That matters here because a block's `outputs` are authored to match its tools' outputs, and the UI now reads those from the generated metadata rather than the executable registry — an unregenerated tool change makes the block's outputs disagree with what the panel renders. See `.agents/skills/tool-registry-boundary/SKILL.md`.
927954

955+
A visible integration block does require the generated integration catalog and docs to be refreshed.
956+
After adding or changing one, run:
957+
958+
```bash
959+
bun run scripts/generate-docs.ts
960+
bun run integration-catalog:check
961+
```
962+
963+
The catalog check independently derives deployment metadata from the executable block registry and
964+
compares it with the committed `apps/sim/lib/integrations/integrations.json`. Review the generated
965+
diff and keep only intentional changes.
966+
928967
## Checklist Before Finishing
929968

930969
- [ ] `integrationType` is set to the correct `IntegrationType` enum value
@@ -934,12 +973,17 @@ But if the same change also adds, edits **or removes** a tool, run `bun run tool
934973
- [ ] DependsOn set for fields that need other values
935974
- [ ] Required fields marked correctly (boolean or condition)
936975
- [ ] OAuth inputs have correct `serviceId` and `requiredScopes: getScopesForService(serviceId)`
976+
- [ ] Every OAuth `serviceId` resolves through `resolveOAuthClientCapabilityId()` to the correct `OAUTH_CLIENT_CAPABILITIES` entry
977+
- [ ] Any new OAuth capability fields exist in `apps/sim/lib/core/config/env.ts`
978+
- [ ] If the OAuth service supports service accounts, `SERVICE_ACCOUNT_METADATA_BY_OAUTH_SERVICE_ID` matches its canonical `serviceAccountProviderId` and deployment requirement
937979
- [ ] Scope descriptions added to `SCOPE_DESCRIPTIONS` in `lib/oauth/utils.ts` for any new scopes
938980
- [ ] Tools.access lists all tool IDs (snake_case)
939981
- [ ] Tools.config.tool returns correct tool ID (snake_case)
940982
- [ ] Outputs match tool outputs
941983
- [ ] Block + meta registered in registry-maps.ts (`BLOCK_REGISTRY` / `BLOCK_META_REGISTRY`)
942984
- [ ] If any tool was added, changed or removed alongside the block: ran `bun run tool-metadata:generate` and committed the artifacts
985+
- [ ] Ran `bun run scripts/generate-docs.ts`, reviewed the generated diff, and committed the integration catalog changes
986+
- [ ] `bun run integration-catalog:check` passes
943987
- [ ] If icon missing: asked user to provide SVG
944988
- [ ] If triggers exist: `triggers` config set, trigger subBlocks spread
945989
- [ ] Optional/rarely-used fields set to `mode: 'advanced'`

.agents/skills/add-column-type/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This was not always true: adding `currency` originally took ~40 edits across 32
1515
Do **not** hunt for places to edit. Add your type to the `ColumnType` union first and let `tsc` produce the list:
1616

1717
```bash
18-
cd apps/sim && bunx tsc --noEmit -p tsconfig.json
18+
cd apps/sim && bun run type-check
1919
```
2020

2121
You will get two errors, naming `column-types/registry.ts` and `column-types/registry.server.ts`. Register in both.
@@ -153,7 +153,7 @@ Registering the *type* is compiler-enforced. Registering its *metadata* is not,
153153

154154
## Final Validation (Required)
155155

156-
1. **`cd apps/sim && bunx tsc --noEmit -p tsconfig.json`** — must be clean. If any file *outside* `column-types/` errors, that file has a hardcoded type list; fix it to read the registry.
156+
1. **`cd apps/sim && bun run type-check`** — must be clean. If any file *outside* `column-types/` errors, that file has a hardcoded type list; fix it to read the registry.
157157
2. **Grep for leaks**`grep -rnE "(===|!==) '{id}'|case '{id}':" apps/sim --include='*.ts' --include='*.tsx' | grep -v column-types/`. (All three forms: a plain `!==` and a `case` are how half of `currency`'s real branches are written.) Hits are expected; judge each. A hit is fine when it mounts a specific React component or encodes a genuinely one-off behavior (`json`'s mono textarea, `date`'s timezone-aware parsing). A hit is a **leak** when it restates something the registry could answer — an icon, a label, a colour, an operator set, a cast, a coercion. Leaks get a registry field, not a new branch.
158158
3. **Run the suite**`bunx vitest run lib/table 'app/workspace/[workspaceId]/tables' lib/api app/api/table app/api/v1 lib/copilot/tools/server/table`. Existing tests must pass **unchanged**; needing to edit one means you changed behavior for the other types.
159159
4. **`bun run lint:check`, `bun run check:api-validation`, `bun run check:client-boundary`** from the repo root.

.agents/skills/add-enrichment/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const ENRICHMENT_REGISTRY: EnrichmentRegistry = {
128128

129129
## Step 5: Verify
130130

131-
1. `bunx tsc --noEmit` (from `apps/sim`, `NODE_OPTIONS=--max-old-space-size=8192`) and `bunx biome check` on the changed files.
131+
1. `bun run type-check` (from `apps/sim`) and `bunx biome check` on the changed files.
132132
2. In a table → **+ New column → Enrichments** → pick the new enrichment, map its inputs to columns, name the output column(s), Save. Confirm it appears in the catalog with its icon/description.
133133
3. With hosted keys (or a workspace BYOK key) configured for each provider's service, run a row and confirm the cell fills; the dev-server log shows `Enrichment hit { provider }`. A row whose providers all miss completes blank; a row where every provider errored shows an error cell.
134134

0 commit comments

Comments
 (0)