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
`packages/sim-setup/src/capability-config.ts`. Do not create integration-specific setup logic or
547
+
infer secret fields from naming; the CLI mapping is exhaustively checked against the runtime
548
+
fields.
549
+
4. If the canonical OAuth service has `serviceAccountProviderId`, run
550
+
`bun run deployment-config:generate` to refresh
551
+
`packages/deployment-config/src/service-account-providers.generated.ts`; never hand-edit the
552
+
generated provider-ID map. In `packages/deployment-config/src/service-account-metadata.ts`, use:
551
553
- no `deploymentRequirement` when the service-account path works independently of OAuth client fields;
552
554
-`'oauth-client'` when it requires the same deployment OAuth client fields;
553
555
-`'preview-gated'` when availability is controlled by the service-account preview block.
@@ -560,15 +562,18 @@ a resolvable capability must fail validation.
560
562
Run the documentation generator:
561
563
```bash
562
564
bun run scripts/generate-docs.ts
565
+
bun run deployment-config:generate
563
566
bun run integration-catalog:check
567
+
bun run deployment-config:check
564
568
bun run docs:check
565
569
```
566
570
567
571
This creates `apps/docs/content/docs/en/integrations/{service}.mdx` — one page per service carrying the block's Actions and, if it has one, its Triggers section. Never hand-edit generated pages; the only editable region is the `{/* MANUAL-CONTENT */}` block (see `scripts/README.md`).
568
572
569
-
The same generator refreshes `apps/sim/lib/integrations/integrations.json`. The catalog check then
570
-
derives the deployment-relevant fields from the executable block registry and compares them with the
571
-
committed projection. Review the generated diff and keep only intentional changes.
573
+
The docs generator refreshes `packages/deployment-config/src/integrations.json`, and the deployment
574
+
config generator projects service-account provider IDs from that catalog plus the canonical OAuth
575
+
registry. The checks compare both committed projections with their sources. Review the generated
576
+
diff and keep only intentional changes.
572
577
573
578
## V2 Integration Pattern
574
579
@@ -647,14 +652,16 @@ If creating V2 versions (API-aligned outputs):
647
652
-[ ] Created `index.ts` barrel export
648
653
-[ ] Registered all triggers in `triggers/registry.ts`
649
654
650
-
### Docs
655
+
### Docs and deployment metadata
651
656
-[ ] Ran `bun run scripts/generate-docs.ts`
657
+
-[ ] Ran `bun run deployment-config:generate` for OAuth or service-account changes
652
658
-[ ] Verified docs file created
653
-
-[ ] Reviewed and committed the generated `apps/sim/lib/integrations/integrations.json` change
659
+
-[ ] Reviewed and committed the generated `packages/deployment-config/src/integrations.json` change
654
660
-[ ]`bun run integration-catalog:check` passes
655
661
-[ ]`bun run docs:check` passes — CI fails on stale generated docs, so commit the full generator
656
662
output, including catch-up regeneration for pages another PR left stale (never revert it as
657
663
"unrelated drift")
664
+
-[ ]`bun run deployment-config:check` passes
658
665
659
666
### Final Validation (Required)
660
667
-[ ] Read every tool file and cross-referenced inputs/outputs against the API docs
11.**Never hardcode scopes** - Use `getScopesForService()` in blocks and `getCanonicalScopesForProvider()` in auth.ts
1003
1010
12.**Always add scope descriptions** - New scopes must have entries in `SCOPE_DESCRIPTIONS` within `lib/oauth/utils.ts`
1004
1011
13.**OAuth service IDs need deployment capabilities** - Every visible OAuth integration must resolve through `OAUTH_CLIENT_CAPABILITIES`; shared Google/Microsoft aliases map to their provider capability
1005
-
14.**Keep runtime and presentation separate** - Runtime OAuth fields live in `env-capabilities.ts`; CLI input modes live in the exhaustively checked `scripts/setup/capability-config.ts` mapping
1012
+
14.**Keep runtime and presentation separate** - Runtime OAuth fields live in `packages/deployment-config/src/env-capabilities.ts`; CLI input modes live in the exhaustively checked `packages/sim-setup/src/capability-config.ts` mapping
The deployment UI and setup CLI do not infer OAuth client fields from scopes. They resolve the
294
-
block's generated `oauthServiceId` through the application-owned capability catalog.
295
+
block's generated `oauthServiceId` through the shared deployment capability catalog.
295
296
296
297
-[ ] The visible integration block has exactly one distinct `oauth-input.serviceId`
297
298
-[ ]`resolveOAuthClientCapabilityId(serviceId)` returns the intended provider capability
298
299
-[ ] The resolved provider exists in `OAUTH_CLIENT_CAPABILITIES`
299
300
-[ ] Every field listed by that capability exists in `apps/sim/lib/core/config/env.ts`
300
301
-[ ] Every capability field has the correct `text` or `secret` entry in `OAUTH_CLIENT_SETUP_FIELDS`; no CLI naming heuristic is required
301
302
-[ ] Shared Google/Microsoft service IDs resolve to their provider capability rather than duplicate entries
302
-
-[ ]`bun run setup integration <capabilityId>` is the command emitted by availability; the CLI has only the exhaustive input-mode projection, not a second runtime provider definition
303
+
-[ ]`npx @sim/setup add integration <capabilityId>` is the command emitted by availability; the CLI has only the exhaustive input-mode projection, not a second runtime provider definition
303
304
-[ ] If the canonical OAuth service declares `serviceAccountProviderId`,
304
-
`SERVICE_ACCOUNT_METADATA_BY_OAUTH_SERVICE_ID[serviceId]` has the same provider ID
305
+
the generated `SERVICE_ACCOUNT_PROVIDER_BY_OAUTH_SERVICE_ID[serviceId]` has the same provider ID
305
306
-[ ] The service-account `deploymentRequirement` matches how that credential actually works:
306
307
omitted for an independent path, `'oauth-client'` when it needs the OAuth client fields, or
307
308
`'preview-gated'` when controlled by a preview block
@@ -386,13 +387,16 @@ Several files are generated from tool and block definitions. Editing a tool or b
386
387
387
388
```bash
388
389
bun run tool-metadata:generate # repo root — apps/sim/tools/generated/*
389
-
bun run scripts/generate-docs.ts # docs .mdx + lib/integrations/integrations.json + docs icons
390
+
bun run scripts/generate-docs.ts # docs .mdx + deployment-config/integrations.json + docs icons
391
+
bun run deployment-config:generate # canonical OAuth registry + catalog → provider-ID facts
390
392
bun run integration-catalog:check # registry ↔ committed deployment metadata drift
391
393
bun run docs:check # committed docs ↔ what the generator renders today
394
+
bun run deployment-config:check # OAuth registry/catalog ↔ provider-ID fact drift
392
395
```
393
396
394
397
-**`tool-metadata:generate`** — required whenever a tool's `outputs`, `params`, or descriptions change. CI enforces this with `bun run tool-metadata:check`, which fails with *"Generated tool metadata is stale"*. This is the easiest gate to miss, because nothing in the tool file hints that a generated artifact mirrors it.
395
-
-**`generate-docs`** — required whenever block metadata changes (`bgColor`, `name`, `description`, operations, outputs). Regenerates the integration `.mdx`, `integrations.json`, and the docs copy of `components/icons.tsx`.
398
+
-**`generate-docs`** — required whenever block metadata changes (`bgColor`, `name`, `description`, operations, outputs). Regenerates the integration `.mdx`, `packages/deployment-config/src/integrations.json`, and the docs copy of `components/icons.tsx`.
399
+
-**`deployment-config:generate`** — required for OAuth or service-account changes. Regenerates provider-ID facts from the canonical OAuth registry and integration catalog; special deployment requirements remain handwritten policy.
396
400
-**`integration-catalog:check`** — loads the executable block registry, derives visible integration
397
401
deployment fields, and compares them with the committed catalog. It catches missing/unexpected
398
402
entries and stale auth/service IDs without loading the executable registry in client code.
@@ -419,9 +423,10 @@ After fixing, confirm:
419
423
4. Derived artifacts regenerated and their diffs reviewed (see above)
420
424
5.`bun run integration-catalog:check` passes
421
425
6.`bun run docs:check` passes
422
-
7. For OAuth or service-account changes, `bun test apps/sim/lib/integrations/availability.server.test.ts` passes
423
-
8. Re-read all modified files to verify fixes are correct
424
-
9. Any remaining unknown response schemas were explicitly reported to the user instead of guessed
426
+
7. For OAuth or service-account changes, `bun run deployment-config:check` passes
427
+
8. For OAuth or service-account changes, `bun run --cwd apps/sim test lib/integrations/availability.server.test.ts` passes
428
+
9. Re-read all modified files to verify fixes are correct
429
+
10. Any remaining unknown response schemas were explicitly reported to the user instead of guessed
425
430
426
431
## Checklist Summary
427
432
@@ -437,7 +442,7 @@ After fixing, confirm:
437
442
-[ ] Validated scope descriptions exist in `SCOPE_DESCRIPTIONS` within `lib/oauth/utils.ts` for all scopes
438
443
-[ ] Validated OAuth `serviceId` resolves to the intended `OAUTH_CLIENT_CAPABILITIES` entry and all capability fields exist in the env schema
439
444
-[ ] Validated service-account projection and deployment requirement against the canonical OAuth service config
440
-
-[ ] Regenerated `integrations.json`when block metadata changed and ran `bun run integration-catalog:check`
445
+
-[ ] Regenerated deployment config when block/OAuth metadata changed and ran both catalog checks
441
446
-[ ] Validated pagination consistency across tools and block
442
447
-[ ] Validated memory load safety using `.agents/skills/memory-load-check/SKILL.md` when tools list/search/download/import/export/batch data
0 commit comments