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
Copy file name to clipboardExpand all lines: .agents/skills/v2-api-conventions/SKILL.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,14 @@ Order matters because each layer is checked against the one before it.
149
149
3.**Route** with `defineV2JsonRoute`, declaring `contract`, `auth: v2ApiKeyAuth`, `operation`, `rateLimit`, `errorPolicy`, `mapInput`, `useCase`, `present`. Auth and rate limiting run before parsing.
150
150
4.**OpenAPI description** in `lib/api/contracts/v2/openapi/<domain>.ts`, then `bun run generate:openapi`. A description that claims behaviour the route does not have is the same class of bug as a wrong schema.
151
151
152
+
### Public descriptions
153
+
154
+
Use the [API description conventions](../../../apps/sim/lib/api/contracts/v2/openapi/README.md) when writing or auditing endpoint and field descriptions. Keep a short action-and-resource summary; use the description for behavior that changes the caller's choice, input, interpretation, or next action. Ordinary operations usually need one to three sentences, with no mandatory minimum.
155
+
156
+
Keep archive versus permanent-delete behavior, replacement versus partial-update semantics, partial success, retry safety, redaction, and asynchronous completion explicit. Verify these claims against the implementation. Describe observable behavior without exposing storage formats, locking mechanisms, internal identifiers, deployment architecture, or implementation history unless that detail changes how the caller must use the API.
157
+
158
+
Put field-specific rules in the source schema and reuse shared authentication and pagination wording. Shared schema descriptions also feed CLI help, so refer to related operation names rather than HTTP paths. Regenerate OpenAPI, CLI metadata, and CLI docs after changing their source descriptions; never hand-edit generated output.
159
+
152
160
## Rule 6 — a transient failure says when to come back
153
161
154
162
A response the caller is *expected* to retry must say how long to wait. Two statuses qualify, and both are wired:
@@ -186,11 +194,13 @@ Audited against the primary specs and against Stripe, GitHub, and Google's AIPs.
186
194
187
195
## Idempotency: at-most-once, not replay
188
196
189
-
`POST /workflows/{id}/execute` accepts `X-Run-Id`, a caller-supplied run identifier claimed through the `idempotency_key` table (`execution-id-claim.ts`). It is a **uniqueness claim, not an idempotency key**, and the distinction is deliberate and already published in the operation description:
197
+
`POST /workflows/{id}/execute` accepts `X-Run-Id` from API-key and OAuth callers; anonymous requests ignore it. It is a **uniqueness claim, not an idempotency key**:
198
+
199
+
- An available ID is claimed before execution starts.
200
+
- An already claimed ID returns **409** with `error.details.code: "RUN_ID_CONFLICT"`, the run id in `error.details.runId`, and an `X-Run-Id` response header. It never replays the earlier run's result — the client recovers it by polling the runs resource.
201
+
- IDs of runs that started remain reserved after their execution logs are deleted.
190
202
191
-
- First use wins and runs.
192
-
- Any reuse returns **409** with `error.details.code: "RUN_ID_CONFLICT"`, the run id in `error.details.runId`, and an `X-Run-Id` response header. It never replays the earlier run's result — the client recovers it by polling the runs resource.
193
-
- Claims are durable tombstones, so deleting execution logs cannot make an id reusable.
203
+
For an uncertain execution outcome, retry with the same run ID or poll Get Workflow Run. A fresh ID or an omitted header can start another execution; never describe either as a safe retry of the original request. Failures before a run starts can release the claim, so phrase the conflict rule as an ID that is already claimed.
194
204
195
205
That makes the money path safe against double-execution **for callers that opt in**. What it is not: a Stripe-style `Idempotency-Key` that stores and replays the original status and body. Building that means a request fingerprint, a retention window, an in-flight-vs-completed distinction (the expired IETF draft would have these be 422 and 409 respectively), and somewhere to put a large synchronous execution body. It is a designed piece of work, not an increment — do not half-build it by aliasing the header name, which would invite clients written against Stripe semantics to treat our 409 as a hard failure.
Copy file name to clipboardExpand all lines: apps/docs/content/docs/cli/blocks.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ sim blocks list [options]
38
38
|`--search <value>`| No | Case-insensitive substring match against the block id, name, and description. |
39
39
|`--category <value>`| No | Restrict to one toolbar category. Accepted values: `blocks`, `tools`, `triggers`. |
40
40
|`--capability <value>`| No | Restrict to blocks that can start a workflow — the `triggers` category, blocks declaring `triggerAllowed`, and blocks with trigger-mode fields. Accepted values: `trigger`. |
41
-
|`--source <value>`| No | Restrict to shipped blocks or to this workspace’s deployed custom blocks. Accepted values: `builtin`, `custom`. |
41
+
|`--source <value>`| No | Restrict to built-in blocks or this workspace's deployed custom blocks. Accepted values: `builtin`, `custom`. |
42
42
|`--sort-by <value>`| No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `id`, `name`, `category`. |
Copy file name to clipboardExpand all lines: apps/docs/content/docs/cli/files.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -286,7 +286,7 @@ sim files list [options]
286
286
| Option | Required | Description |
287
287
| --- | --- | --- |
288
288
|`--folder <value>`| No | Folder path as shown in the app; the leading / is optional. |
289
-
|`--recursive`| No |Whether the folder filter includes files in subfolders. Defaults to true when a search is set, false otherwise, so listing a folder shows that folder while searching one looks through everything in it. Ignored when no folder filter is set, which already spans the workspace. |
289
+
|`--recursive`| No |Include subfolders in the folder filter. Defaults to true when searching and false otherwise. Ignored without a folder filter. |
290
290
|`--no-recursive`| No | Send --recursive as false. |
291
291
|`--scope <value>`| No | Which lifecycle set to list: `active` (default) for live files, `archived` for files a delete soft-deleted. `folderPath` resolves against active folders only, so pairing it with `scope=archived` returns an empty page when the containing folder was archived too. Accepted values: `active`, `archived`. |
292
292
|`--search <value>`| No | Case-insensitive substring match against the file name. |
Copy file name to clipboardExpand all lines: apps/docs/content/docs/cli/knowledge.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1001,7 +1001,7 @@ sim knowledge list [options]
1001
1001
1002
1002
| Option | Required | Description |
1003
1003
| --- | --- | --- |
1004
-
|`--scope <value>`| No |Which lifecycle set to list: `active` (default) for live knowledge bases, `archived` for knowledge bases a `DELETE` archived and `POST /knowledge/{knowledgeBaseId}/restore` can bring back. `folderPath` resolves against active folders only, so pairing it with `scope=archived` returns an empty page when the containing folder was archived too. Accepted values: `active`, `archived`. |
1004
+
|`--scope <value>`| No |Lifecycle scope: active or archived knowledge bases. Use Restore Knowledge Base to recover archived entries. Folder paths resolve only active folders, so filtering by an archivedfolder returns no matches. Accepted values: `active`, `archived`. |
1005
1005
|`--folder <value>`| No | Folder path as shown in the app; the leading / is optional. |
1006
1006
|`--search <value>`| No | Case-insensitive substring match against the resource name. |
1007
1007
|`--sort-by <value>`| No | Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order. Accepted values: `name`, `createdAt`, `updatedAt`. |
Copy file name to clipboardExpand all lines: apps/docs/content/docs/cli/logs.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ sim logs stats [options]
53
53
|`--level <value>`| No | Severity level to include. Accepted values: `info`, `error`. |
54
54
|`--start-date <value>`| No | Only include runs started at or after this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant. |
55
55
|`--end-date <value>`| No | Only include runs started at or before this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant. |
56
-
|`--segment-count <value>`| No | Number of equal time buckets to divide the window into, from 1 to 500. Exactly this many buckets are always returned. Buckets are never narrower than one minute, so on a short window the series extends past the end of the window rather than being compressed, and the trailing buckets are empty. |
56
+
|`--segment-count <value>`| No | Number of time buckets, up to 500. Exactly this many are returned, each at least one minute wide. Short windows extend past the requested end and include empty trailing buckets. |
|`--description <value>`| No | Optional server description. |
26
-
|`--transport <value>`| No | Transport used to communicate with the server. Applied server-side as `streamable-http`when omitted on create. Accepted values: `streamable-http`. |
26
+
|`--transport <value>`| No | Transport protocol. Defaults to `streamable-http` on creation. Accepted values: `streamable-http`. |
27
27
|`--url <value>`| Yes | Absolute HTTP or HTTPS endpoint URL without `{{ENV_VAR}}` references. It determines server identity and is immutable: delete and recreate the server to change endpoints. |
28
28
|`--auth-type <value>`| No | Authentication method. When omitted, and no `headers` are sent, registration probes the endpoint once to classify it, falling back to `headers` when the probe fails or the server does not advertise OAuth. A server publishing RFC 9728 metadata is therefore stored as `oauth`, and headers configured afterwards will not authenticate — send this field explicitly to pin the method. Accepted values: `none`, `headers`, `oauth`. |
29
29
|`--headers <json\|@file>`| No | Write-only request headers sent to the server. Replaced wholesale rather than merged on update: sending this field drops every stored header it does not repeat. (JSON, or @path / @- to read a file or stdin). |
30
-
|`--timeout <value>`| No | Per-request timeout in milliseconds. Applied server-side as 30000 when omitted on create. |
31
-
|`--retries <value>`| No | Number of retries per request. Applied server-side as 3 when omitted on create. |
32
-
|`--enabled`| No | Whether the server tools are available to workflows. Applied server-side as true when omitted on create. |
30
+
|`--timeout <value>`| No | Per-request timeout in milliseconds. Defaults to 30000 on creation. |
31
+
|`--retries <value>`| No | Number of retries per request. Defaults to 3 on creation. |
32
+
|`--enabled`| No | Whether workflows can use the server's tools. Defaults to true on creation. |
33
33
|`--no-enabled`| No | Send --enabled as false. |
34
34
|`--oauth-client-id <value>`| No | Pre-registered OAuth client identifier. Changing it on update revokes the stored OAuth grant and forces reauthorization. |
35
35
|`--oauth-client-secret <value>`| No | Write-only pre-registered OAuth client secret. Sending it on update as null or a new value revokes the stored OAuth grant and forces reauthorization, as does switching away from OAuth authentication. (--oauth-client-secret null sends the word, not JSON null). |
@@ -121,7 +121,7 @@ List MCP Server Tools (OAuth login or personal API key required)
121
121
122
122
| Option | Required | Description |
123
123
| --- | --- | --- |
124
-
|`--refresh`| No |Bypass the short-lived per-workspace tool cache and reconnect under your own credentials. A cached result reflects whichever workspace member last ran discovery, so this is the only way to pick up a tool added since then; it costs a live round trip. |
124
+
|`--refresh`| No |Refresh tools using your credentials. Otherwise results may reuse another workspace member's recent discovery and omit newly added tools. |
|`--description <value>`| No | Optional server description. |
153
-
|`--transport <value>`| No | Transport used to communicate with the server. Applied server-side as `streamable-http`when omitted on create. Accepted values: `streamable-http`. |
153
+
|`--transport <value>`| No | Transport protocol. Defaults to `streamable-http` on creation. Accepted values: `streamable-http`. |
154
154
|`--url <value>`| No | Immutable server URL. When provided, it must equal the current URL; use delete and create to change endpoints. |
155
155
|`--auth-type <value>`| No | Authentication method. When omitted, and no `headers` are sent, registration probes the endpoint once to classify it, falling back to `headers` when the probe fails or the server does not advertise OAuth. A server publishing RFC 9728 metadata is therefore stored as `oauth`, and headers configured afterwards will not authenticate — send this field explicitly to pin the method. Accepted values: `none`, `headers`, `oauth`. |
156
156
|`--headers <json\|@file>`| No | Write-only request headers sent to the server. Replaced wholesale rather than merged on update: sending this field drops every stored header it does not repeat. (JSON, or @path / @- to read a file or stdin). |
157
-
|`--timeout <value>`| No | Per-request timeout in milliseconds. Applied server-side as 30000 when omitted on create. |
158
-
|`--retries <value>`| No | Number of retries per request. Applied server-side as 3 when omitted on create. |
159
-
|`--enabled`| No | Whether the server tools are available to workflows. Applied server-side as true when omitted on create. |
157
+
|`--timeout <value>`| No | Per-request timeout in milliseconds. Defaults to 30000 on creation. |
158
+
|`--retries <value>`| No | Number of retries per request. Defaults to 3 on creation. |
159
+
|`--enabled`| No | Whether workflows can use the server's tools. Defaults to true on creation. |
160
160
|`--no-enabled`| No | Send --enabled as false. |
161
161
|`--oauth-client-id <value>`| No | Pre-registered OAuth client identifier. Changing it on update revokes the stored OAuth grant and forces reauthorization. |
162
162
|`--oauth-client-secret <value>`| No | Write-only pre-registered OAuth client secret. Sending it on update as null or a new value revokes the stored OAuth grant and forces reauthorization, as does switching away from OAuth authentication. (--oauth-client-secret null sends the word, not JSON null). |
0 commit comments