Skip to content

Commit ef5112c

Browse files
authored
v0.9.65: workflows as code, pierre editor, redis required
2 parents e28e35b + ffda23f commit ef5112c

2,705 files changed

Lines changed: 402298 additions & 44692 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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,13 +1018,15 @@ When adding or changing `sunset.replacedBy`, run `bun run generate:block-success
10181018
map to resolve legacy and current block IDs consistently without importing the executable registry.
10191019
Verify it with `bun run check:block-successors`.
10201020

1021+
A new block type also needs `bun run generate:sdk-names` (commit the new `apps/sim/blocks/sdk-names/<type>.json` and the regenerated `apps/sim/blocks/sdk-names.generated.ts`; names are add-only, and a merge conflict in the generated module is resolved by rerunning the generator) so workflow source gets a typed builder for it; `check:sdk-names` fails CI until it runs.
1022+
10211023
Adding a block on its own needs no **tool metadata** regeneration — a block references existing
10221024
tool IDs through `tools.access` and does not change any tool's shape.
10231025

10241026
But if the same change also adds, edits **or removes** a tool, run `bun run generate:tool-metadata` 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 reads those from the generated metadata, not 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`.
10251027

10261028
A visible integration block does require the generated integration catalog and docs to be refreshed:
1027-
`bun run generate:tool-metadata` (only when a tool changed), `bun run scripts/generate-docs.ts`,
1029+
`bun run generate:tool-metadata` (only when a tool changed), `bun run generate:docs`,
10281030
`bun run generate:deployment-config`, then `bun run check:audits`. Also run
10291031
`bun run apps/sim/scripts/check-block-registry.ts origin/staging` (CI runs it outside `check:audits`). Commit the
10301032
full generator output. For what each check verifies, see the `validate-integration` skill →
@@ -1049,7 +1051,7 @@ Regenerate Derived Artifacts.
10491051
- [ ] Block + meta registered in registry-maps.ts (`BLOCK_REGISTRY` / `BLOCK_META_REGISTRY`)
10501052
- [ ] If `sunset.replacedBy` changed: regenerated and committed the block successor map; `bun run check:block-successors` passes
10511053
- [ ] If any tool was added, changed or removed alongside the block: ran `bun run generate:tool-metadata` and committed the artifacts
1052-
- [ ] Ran `bun run scripts/generate-docs.ts`, reviewed the generated diff, and committed the integration catalog changes
1054+
- [ ] Ran `bun run generate:docs`, reviewed the generated diff, and committed the integration catalog changes
10531055
- [ ] `bun run check:integration-catalog` passes
10541056
- [ ] `bun run check:docs` passes (CI gate — fails on any stale generated docs page)
10551057
- [ ] If icon missing: asked user to provide SVG

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ Registering the *type* is compiler-enforced. Registering its *metadata* is not,
141141

142142
Copy `currency`'s service function and orchestration branch.
143143

144+
## Workspace source and the workflow SDK
145+
146+
The workspace source table codec reads the registry, but the SDK restates each type: add the
147+
`column.<type>()` helper to `packages/workflow-sdk/src/workspace/table.d.ts` (the drift test in
148+
`apps/sim/lib/workspace-source/application/kinds/table/codec.test.ts` fails until you do), map the
149+
type's row value in `valueType()` (`packages/workflow-sdk/src/codegen/workspace.ts`, which defaults to
150+
`string`), and regenerate the embedded text (`bun packages/workflow-sdk/scripts/generate-embedded-text.ts`).
151+
See `.claude/rules/sim-workflow-code.md`.
152+
144153
## Checklist Before Finishing
145154

146155
- [ ] Id appended to `COLUMN_TYPES` in `column-types/types.ts`

‎.agents/skills/add-integration/SKILL.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ service id:
111111
`mode: 'advanced'`. An existing block that already takes the secret inline is never edited in
112112
place: add a credential-only successor (`add-block` → Credential-only successor).
113113

114-
Then run `generate-docs`, `generate:block-successors`, `generate:deployment-config`, and
115-
`generate:tool-metadata`, and `check-block-registry.ts origin/staging`. This pattern does not fit
114+
Then run `bun run generate` (every generated artifact, docs included) and
115+
`check-block-registry.ts origin/staging`. This pattern does not fit
116116
hosted-key tools, model-provider keys, two-secret or username/password logins, or a host chosen
117117
per call.
118118

@@ -371,6 +371,8 @@ export const BLOCK_META_REGISTRY: Record<string, BlockMeta> = {
371371
}
372372
```
373373

374+
Then run `bun run generate:sdk-names` and commit the new `apps/sim/blocks/sdk-names/<type>.json` and the regenerated `apps/sim/blocks/sdk-names.generated.ts` (names are add-only: never edit or delete an existing entry; on a merge conflict in the generated module, rerun the generator), so workflow source gets a typed builder for the new block (`check:sdk-names` fails CI until it runs).
375+
374376
### Trigger Registry (`apps/sim/triggers/registry.ts`) - If triggers exist
375377

376378
```typescript
@@ -436,7 +438,7 @@ a resolvable capability must fail validation; an independent service account use
436438

437439
## Step 8: Generate and Validate the Catalog
438440

439-
Run `bun run generate:tool-metadata`, `bun run scripts/generate-docs.ts`,
441+
Run `bun run generate:tool-metadata`, `bun run generate:docs`,
440442
`bun run generate:deployment-config`, then `bun run check:audits` (see the `validate-integration`
441443
skill → Regenerate Derived Artifacts for the full list and what each check verifies).
442444

@@ -462,7 +464,7 @@ In Sim, the {Service} block lets your agents {concrete workflow uses}.
462464

463465
Group the bullets by what the user gets done, not one bullet per tool. Only describe operations the
464466
block actually ships. Follow `.claude/rules/constitution.md` for voice. Re-run
465-
`bun run scripts/generate-docs.ts` afterwards and confirm the section survived unchanged.
467+
`bun run generate:docs` afterwards and confirm the section survived unchanged.
466468

467469
The docs generator refreshes `packages/deployment-config/src/integrations.json`, and the deployment
468470
config generator projects service-account provider IDs from that catalog plus the canonical OAuth
@@ -580,7 +582,7 @@ If creating V2 versions (API-aligned outputs):
580582
- [ ] Registered all triggers in `triggers/registry.ts`
581583

582584
### Docs and deployment metadata
583-
- [ ] Ran `bun run scripts/generate-docs.ts`
585+
- [ ] Ran `bun run generate:docs`
584586
- [ ] Ran `bun run generate:deployment-config` for OAuth or service-account changes
585587
- [ ] Verified docs file created
586588
- [ ] Wrote the `{/* MANUAL-CONTENT-START:intro */}` section under `<BlockInfoCard />` and confirmed it survives a regenerate

‎.agents/skills/add-tools/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ If creating V2 tools (API-aligned outputs), use `_v2` suffix:
620620
- [ ] Index.ts exports all tools and re-exports types (`export * from './types'`)
621621
- [ ] Tools registered in `tools/registry.ts`
622622
- [ ] `bun run generate:tool-metadata` run and the regenerated artifacts committed
623-
- [ ] `bun run scripts/generate-docs.ts` run and the refreshed docs committed — the integration's
623+
- [ ] `bun run generate:docs` run and the refreshed docs committed — the integration's
624624
docs page is rendered from each tool's description, params, and outputs, and CI's
625625
`bun run check:docs` fails on stale pages
626626
- [ ] Block wired: `tools.access`, dropdown options, subBlocks, `tools.config`, outputs, inputs

‎.agents/skills/add-trigger/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,6 @@ registered `InternalToolConfig.operation`; a `directExecution` property fails
543543
- [ ] `bun run type-check` passes
544544
- [ ] Manually verify output keys match trigger `outputs` keys
545545
- [ ] Trigger UI shows correctly in the block
546-
- [ ] Ran `bun run scripts/generate-docs.ts` and committed the refreshed pages — trigger sections
546+
- [ ] Ran `bun run generate:docs` and committed the refreshed pages — trigger sections
547547
render into the owning integration's docs page, and CI's `bun run check:docs` fails on stale
548548
pages

‎.agents/skills/db-migrate/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The lint flags risky *shapes*; it cannot know whether a given drop is *safe righ
8383
```
8484
The reason must be specific and name the PR/version that removed the dependency. An empty reason fails the lint.
8585
- **Warnings** (`data-backfill`): non-blocking, but confirm the batching/idempotency before merging.
86-
4. Regenerate the test schema mock: `bun run scripts/generate-schema-mock.ts` (`check:schema-mock` in `check:audits` fails after any `schema.ts` change until you do).
86+
4. Regenerate the test schema mock: `bun run generate:schema-mock` (`check:schema-mock` in `check:audits` fails after any `schema.ts` change until you do).
8787
5. Re-run `(cd packages/db && bunx drizzle-kit generate)` once your migration is written: it must report no schema changes and write no new file, or CI fails on the schema and migrations disagreeing.
8888
6. Verify locally: `cd packages/db && bun run db:migrate` against a dev DB.
8989

‎.agents/skills/ship/SKILL.md‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,19 @@ When the user runs `/ship`:
4747
- Run `/db-migrate` to review the migration for zero-downtime safety (expand/contract phasing, backward-compatibility with the deployed app version).
4848
- `(cd packages/db && bunx drizzle-kit generate && git status --porcelain ./migrations)` must print nothing (CI's schema/migration sync step).
4949
- `bun run check:migrations origin/staging` must pass (staging is the PR base). Do not silence a flagged statement with a `-- migration-safe:` annotation unless `/db-migrate` confirmed the old code no longer depends on it; otherwise split the destructive change into a later deploy.
50-
6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `lint` job enforces. Both phases parallelize — but only across commands that write **disjoint** outputs — and a bare `wait` swallows child exit codes, so both phases below explicitly collect each job's status and abort ship if any failed.
50+
6. **Run pre-ship checks** from the repo root before staging. This has two phases: first **regenerate** every committed artifact so generated files never drift into a CI failure (this is what catches things like `agent-stream-docs` going stale after a `models.ts` edit), then run the **full audit suite** CI's `lint` job enforces. Both phases abort ship if any generator or audit fails: their runners (`scripts/generate-all.ts`, `scripts/run-audits.ts`) collect each job's exit code and exit non-zero, so never replace them with a backgrounded loop and a bare `wait`, which swallows child exit codes.
5151
52-
**Phase A — regenerate the always-in-repo committed artifacts (parallel), then let step 7 stage whatever changed.** Regenerate only the generators whose inputs live entirely in this repo and that any ordinary code change can drift — `generate:agent-stream-docs` (derives from the provider model registry), `generate:docs-manifest` (derives from docs page paths), `generate:tool-metadata` (derives from the tool registry), and `skills:sync` (derives from `.agents/skills/**`). They write disjoint outputs (`apps/docs/…/agent.mdx`, `apps/sim/lib/mothership/generated/docs-manifest.ts`, `apps/sim/tools/generated/*`, and `.claude/skills` links), so they parallelize safely, and each is idempotent (a no-op when already in sync):
52+
**Phase A — regenerate the always-in-repo committed artifacts, then let step 7 stage whatever changed.** Run the umbrella generator. It derives its list from package.json (every `generate:<x>` that has a matching `check:<x>`, plus `skills:sync`; see the header of `scripts/generate-all.ts`), so it covers every repo-local generator an ordinary code change can drift (a `models.ts` edit drifts `agent-stream-docs` and the SDK fixture catalog, a tool change drifts `tool-metadata`), runs them in the order their inputs require, and each is idempotent (a no-op when already in sync):
5353
```bash
54-
rm -f /tmp/ship-gen-results
55-
for g in generate:agent-stream-docs generate:docs-manifest generate:tool-metadata skills:sync; do
56-
( bun run "$g" >"/tmp/ship-gen-${g//:/-}.log" 2>&1; echo "$? $g" >>/tmp/ship-gen-results ) &
57-
done
58-
wait
59-
# any non-zero line is a FAILED generator — read /tmp/ship-gen-<name>.log and fix before shipping;
60-
# a silently-failed generate leaves a stale artifact that Phase B / CI then rejects. Keep the
61-
# `exit 1`: it is what makes the block's own status non-zero so a caller actually stops.
62-
if grep -vE '^0 ' /tmp/ship-gen-results; then echo "❌ generator(s) failed — do not ship"; exit 1; fi
54+
# A non-zero exit means a generator FAILED: the summary names it and its output is above. Fix it
55+
# before shipping; a silently-failed generate leaves a stale artifact that Phase B / CI then
56+
# rejects. Keep the `exit 1`: it makes the block's own status non-zero so a caller actually stops.
57+
bun run generate || { echo "❌ generator(s) failed — do not ship"; exit 1; }
6358
echo "✅ artifacts regenerated"
6459
```
6560
Then `git status --short` to see what regenerated — those files must be staged in step 7 alongside your own changes.
6661
67-
**Do NOT blanket-run the domain generators here.** `mship:generate` (`generate-mship-contracts.ts`) is an **umbrella** that drives all nine mothership contract generators (`mship-contracts`, `billing-protocol-contract`, `mship-tools`, the four `trace-*`, `metrics-contract`, `vfs-snapshot-contract`) and biome-formats `apps/sim/lib/mothership/generated/` — never run it *and* its constituents (they write the same files and corrupt each other in parallel), and never run it on an ordinary ship: it reads an **external** copilot-contract source that isn't checked out in most worktrees, so it hard-fails with `ENOENT` and would abort ship for an unrelated reason. `generate:pi-model-catalog` (under `apps/sim`) likewise regenerates from the installed Pi package, not repo source. `scripts/generate-docs.ts` rewrites the integration docs and client-safe catalog; run it when this PR changes their block/icon/landing-content inputs or when `check:integration-catalog` reports drift, then review its broad generated diff. Only when **this PR's diff actually touches** a domain generator's input do you regenerate it deliberately and run its matching `:check` (`bun run mship:check` / the individual `*:check`) — with the external source present.
62+
**Do NOT blanket-run the domain generators here.** `mship-tools:generate` merges Sim's tool contracts into the base tool catalog in the **external** Mothership worker checkout (`<mothership>/worker/packages/contracts/tool-catalog-v1.json`), which most worktrees lack, so it hard-fails with `ENOENT` and would abort ship for an unrelated reason. The other mothership contracts in `apps/sim/lib/mothership/generated/` are copied in by the worker's `contracts:sync`, never generated here. `generate:pi-model-catalog` (under `apps/sim`) likewise regenerates from the installed Pi package, not repo source. `scripts/generate-docs.ts` rewrites the integration docs and client-safe catalog; run it when this PR changes their block/icon/landing-content inputs or when `check:integration-catalog` reports drift, then review its broad generated diff. Only when **this PR's diff actually touches** a domain generator's input do you regenerate it deliberately and run its matching `:check` (e.g. `bun run mship-tools:check`) — with the external source present.
6863
6964
**Phase B — run lint + every audit CI enforces, in parallel, and abort ship if any fails.** Before running the commands, compare this list with `.github/workflows/checks.yml`; when CI adds an audit, run it and update this skill instead of trusting a stale snapshot. The env-flag audit is currently an inline workflow block rather than a package script: when `apps/sim/lib/core/config/env-flags.ts` changed, run that current workflow block verbatim instead of copying a second version into this skill. Run `bun run lint` first (it autofixes formatting and mutates files, so don't parallelize it with the read-only audits), then run the base-sensitive block-registry check, then fan the independent audits out and collect exit codes:
7065
```bash

‎.agents/skills/v2-api-conventions/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Audited against the primary specs and against Stripe, GitHub, and Google's AIPs.
182182
| **`X-RateLimit-Reset` as delta-seconds** | No | It is an absolute ISO 8601 timestamp, so it is clock-skew sensitive — but the response where timing actually decides behaviour (429) also carries `Retry-After`, which is skew-free. The absolute value stays useful for scheduling. |
183183
| **422 for semantic validation** | No | RFC 9110 §15.5.21 defines 422, but Appendix B.3 records that 9110 **deleted** RFC 4918's clause saying 400 was inappropriate. 400 covers "cannot or will not process… perceived to be a client error". The split is convention, not requirement — GitHub splits, Stripe and Google do not. Our machine-readable `error.code` already carries the distinction, and restatusing now breaks clients. |
184184
| **`Location` on 201** | No | §9.3.3 makes this a `SHOULD` **for POST**; the status code itself (§15.3.2) requires nothing and defines the fallback — absent `Location`, the target URI identifies the resource. Declined knowingly: several 201 responses (signed upload sessions, table exports, knowledge folders) have no canonical single-resource GET, so a `Location` would 404, and adopting it on some of the 19 is worse for a client than on none. Every 201 returns the full representation including its `id`. Revisit per-route if one gains a canonical GET. |
185-
| **ETag / `If-None-Match` / `If-Match`** | No | Every v2 response is `Cache-Control: private, no-store` per-caller data, so `If-None-Match` buys nothing. For writes, `If-Match` needs a **strong** validator: §8.8.3.2's strong comparison fails if *either* tag is weak, so a weak ETag silently makes every `If-Match` fail. None of the three surveyed APIs does HTTP optimistic concurrency — Google does the semantics via a resource `etag` **field** (AIP-154), deliberately not the header. If Sim needs optimistic concurrency, do it that way. |
185+
| **ETag / `If-None-Match` / `If-Match`** | No | Every v2 response is `Cache-Control: private, no-store` per-caller data, so `If-None-Match` buys nothing. The exception is a content-addressed read (the source catalog) that sets the route builder's `entityTag`: its 200 and 304 say `private, no-cache`, so the client keeps the body and revalidates it. For writes, `If-Match` needs a **strong** validator: §8.8.3.2's strong comparison fails if *either* tag is weak, so a weak ETag silently makes every `If-Match` fail. None of the three surveyed APIs does HTTP optimistic concurrency — Google does the semantics via a resource `etag` **field** (AIP-154), deliberately not the header. If Sim needs optimistic concurrency, do it that way. |
186186
| **`Deprecation` / `Sunset` on v1** | Not yet | RFC 9745 (Standards Track) and RFC 8594 (Informational) both apply, and GitHub emits both. But `Sunset` is a timestamp and 9745 §4 makes `Sunset >= Deprecation` a `MUST`, so emitting either commits Sim to a v1 retirement date — a product decision, not an engineering one. When that date exists: `Deprecation` is an RFC 9651 Structured Field **Date** (`@1688169599`); `Sunset` is an **HTTP-date** (`Sat, 31 Dec 2033 23:59:59 GMT`). Two encodings in one response — the most common implementation error here. |
187187
| **`application/merge-patch+json`** | No | v2 PATCH bodies are merge-patch *shaped* — absent means unchanged, `null` clears — but they are `.strict()`, so unknown members are rejected where RFC 7396 §2 would merge them, and nested objects are replaced wholesale rather than merged. Advertising the media type would over-claim. Document the semantics per contract instead. |
188188

0 commit comments

Comments
 (0)