mirror of
https://github.com/simstudioai/sim.git
synced 2026-11-20 12:08:01 +08:00
fix/workflow-code-staging-qa
638
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
bc8f09ccb1 |
feat(workflow-code): workflows and workspace as code (#10129)
* test: type the MCP base address the concealment check compares
* fix(workspace-code): check file path collisions on a segment tree, not a map of every prefix
Keeping every folder prefix of every path still held about a million prefix strings for
20,000 deep paths. A tree of folded segments costs one fold per segment and holds each
segment once, so the depth cap is no longer needed.
* refactor: drop the exports of isSuspiciousCharacter and readFolderWritten, used only in their files
* docs(workflow-code): CI needs a personal key; document workspace-key E_APPLY_FORBIDDEN and --only
workflows.source.apply and create deny workspace API keys, so the CI guidance now asks for a
personal API key or an OAuth login. Workspace as code names the kinds a workspace key cannot
write (workflows, skills, secrets, deployments), the E_APPLY_FORBIDDEN refusal, and narrowing
an apply with --only.
* docs(workflow-code): link the code pages from workflows, CLI, getting started, API and MCP
Adds a For coding agents section to Workflows as code (get, edit, check, status, apply, starting
from .sim/AGENTS.md), a prefer-source note on the API build guide, and an MCP section on editing
a whole workflow with getWorkflowSource and applyWorkflowSource.
* docs(self-hosting): document the WORKFLOW_CODE preview flag
Adds a Preview features section with WORKFLOW_CODE and links it from the in-preview callouts on
the workflows and workspace as code pages.
* feat(workflow-code): Code tab header with Preview label, CLI copy and docs; Download as code
The Code tab gets a title row: a Preview badge, a button copying
sim workflows source get <workflowId> --dir ./<workflow-name-slug>, and a link to the docs.
The workflow menu gains Download as code beside Export workflow, saving the draft as the
single TypeScript file the Code tab shows (function code inline). The download revalidates the
cached source by ETag first, so an edit since the tab last read is never missed.
* chore(rules): load the workflow-code rule for the v2 source routes, contracts and staging cleanup
* feat(llms): list workflows as code in llms.txt
* docs(cli): workflows and workspaces as code in the README, help epilogue and source group descriptions
Adds a README section (get, check, status, diff, apply and the coding-agent loop), a source get
example to the root help, and describes both source groups as read and apply, marked (preview)
while the server flag gates them. Regenerating the CLI docs changes nothing: the pages list each
command, not group descriptions or the root epilogue.
* test(workspace-source): a re-run adopting a stopped MCP replace with stored() headers still needs an admin
A workspace key re-running an interrupted replace is refused with E_APPLY_FORBIDDEN, the
owner's re-run finishes it, and a read-only member's get prints the adopted server's
literal headers as stored().
* feat(workflow-code): roll the workflow-code flag out by organization, workspace or user
Every source use case, the Code tab layout and useFeatureFlag now evaluate
workflow-code against the workspace, its organization and the acting user,
so AppConfig orgIds/workspaceIds/userIds allowlists take effect. Adds the
rollout plan to the workflow-code design doc.
* feat(mothership): grant the workflow-code entitlement where the source commands run
computeEntitlements now sends workflow-code to the worker for a workspace or
organization chat whose rollout has the flag on, ahead of the worker's
ENTITLEMENTS enum (the wire accepts any name). The CLI inventory marks every
workflows source and workspaces source command with entitlement: workflow-code
so the worker can hide them once it reads the field.
* docs(api): say how workspace source blobs are staged, and that dryRun previews
The applyWorkspaceSource description pointed MCP readers at Stage Workspace
Source Blobs, a multipart route MCP does not expose; it now names the CLI and
the blob upload route. The MCP write tool no longer claims no write can be
previewed: the source applies take dryRun.
* feat(analytics): record workflow source reads and dry runs, and workspace source applies
Adds workflow_source_read, workflow_source_dry_run and workspace_source_applied
beside workflow_source_applied: same attribution, kinds and counts only. A
refused dry run is now a dry-run event, never an apply.
* docs(workflows): commit written.json and point workspace CI to its own section
* test: read the MCP server URL as nullable in the stopped-replace check
* test(workflow-code): resolve the workspace before the flag in the HEAD 403 check
The flag now needs the workspace's organization, so the read routes resolve
the workspace first; the test gives them one to resolve.
* test(analytics): one workspace_source_applied per apply, refused, partial or committed
Busy, rejected and partial applies each record exactly one event with their
outcome, the committed retry one more, and a dry run none.
* fix(cli): resend a rate-limited GET even when its response body is lost
Cancelling an errored body rejects, so a 429 whose body was lost threw the raw
stream error instead of resending.
* fix(tests): order the workspace source "nothing was written" snapshots by id
The snapshots compared before and after a refused apply selected rows with no
ORDER BY, so their order was whichever index the planner chose: on the
workflow table the sort, unique-name and workspace_id indexes each return a
workspace's rows in a different order. Once autovacuum analyzed the table
between the two reads the plan could change, and the cross-kind test failed
with equal rows in a different order. Forcing the second read off index scans
reproduced the exact failure; ordering by id makes the comparison
plan-independent.
* refactor(source): one vocabulary for the fingerprint of what the server stores
PlannedChange.serverFingerprint is storedFingerprint and KindAdapter.fingerprintNow is
storedFingerprintNow; the workflow adapter's currentFingerprint() is readStoredFingerprint;
the sf1: helper in print-stored is storedSourceFingerprint, beside the kinds' rf1:
storedFingerprint; the workflow apply's local and EvaluatedSource field are storedFingerprint,
as source-commit already named it. The 409 wire field currentFingerprint is unchanged.
* fix(workflow-sdk): the workspace runtime exports defineSecrets and defineCredentials
secrets.d.ts and credentials.d.ts declare them and the cookbook imports them, but the
runtime entry did not export them, so running such a file failed with 'export not found'
instead of SimSdkNotExecutable. codeFile now re-exports core's stub, as tool.d.ts declares.
A test keeps the runtime's exports equal to every value the declarations declare.
* fix(workspace-source): re-scan deletes for new users under the apply lease
The plan's in-use scan ran before the lease, so an apply that saved a workflow
using a resource another apply was about to delete went unseen: the deleting
apply took the lease and deleted anyway. The apply now scans its deletes again
once it holds the lease and refuses (E_APPLY_STALE, nothing written) a delete
that a workflow the plan did not find now uses; a scan timeout still fails
closed.
* fix(cli): take a stale source-directory lock over safely, never through a link
Two commands that found one lock stale could both remove it: the later one's
removal deleted the live lock the first had taken, admitting two writers. A
takeover now claims the stale lock folder it removes (only one command can) and
checks it is still stale first, so a lock that replaced it is left alone.
The lock path also bypassed the source directory's symlink checks: a .sim or
command.lock that is a link was followed. Both are now refused
(SOURCE_SYMLINK) before the lock is created, read or removed.
* fix(cli): workflow commands in a workspace folder hold the workspace directory lock
A single-workflow apply, create or get inside workflows/<key>/ of a workspace
directory rewrites the workspace's written record and base, but took no lock, so
it could interleave with a workspace command (or another folder's) and lose a
record. These commands now hold the workspace directory's command lock for the
whole command, refused like a workspace command (SOURCE_DIR_BUSY, exit 10)
with nothing read or written.
* fix(cli): status recommends commands in its own scope, with --allow-delete for dropped data
The command workspaces source status recommended dropped the scope it was asked
for: status --only tables suggested an apply of every kind, and a status pointed
at a workspace with --workspace suggested one at the profile's. Every
recommended command now carries --only and, when the target is not the
profile's default, --workspace.
It also asked for --allow-delete only for whole-resource deletes, so an update
that drops a column was suggested without it and refused. It now uses the same
destructive count the apply prints.
* fix(cli): an apply that reprints a tool as stored() removes its old code file
When the server keeps a tool's code as stored() (it holds a credential), the
apply reprints tools/<key>.ts without tools/<key>.js, but saving the answer
left the old .js and its digest behind, so the next apply failed with
E_TOOL_CODE. Saving an apply now removes, from disk and the written record,
every text file the directory sent for a reprinted resource that the reprint no
longer holds (workflow folders keep pruning by lock).
* refactor(table): move cell value rules into @sim/workspace-code/table-cells
The per-type coerce/validate/salvage/equality rules, the row loops (required
cells, coercion policy, batch unique scan) and the pure date, currency, ttl and
select helpers move from apps/sim/lib/table into the workspace-code package
(timezone helpers into @sim/utils/timezone). The column-type registry spreads
CELL_RULES into each definition and validation.ts delegates, so there is one
implementation. The workspace source table adapter refuses declared rows with
refusedTableRows, which the CLI can now run offline.
* feat(sim-cli): workspaces source check validates table rows files offline
Each tables/<key>.rows.jsonl (managed or seed) is read against its declaration
and checked with the write's own rules (refusedTableRows): a malformed line, an
undeclared column, a managed key two lines share, an empty required cell, a
unique value two rows share, a value its column's type or options cannot hold.
Each is an E_TABLE_ROWS error at its line.
* fix(workspace-source): credential adoption never takes a credential from a key bound outside source
* test(workspace-code): assert linear growth, not a wall-clock budget, for hostile inputs
The file-grouping test asserted 20,000 deep paths group within 6 s and took 7.2 s
on a CI runner. It now counts the characters case folding reads at depth 100 and
400 (about 4x linear, 15x for the per-prefix fold it guards against), which no
machine load changes. The two compile tests with a 3 s budget (JWT pattern,
numeric precision) now compare the fastest of three runs at n and 4n: reverting
either fix gives about 15x against a bound of 9.
* fix(table): a seed reshape refuses a table that gained rows since the plan saw it empty
* fix(table): a keyed row write inside a reshape runs at the bulk-write statement timeout
* fix(workspace-source): hold the apply lease from before the plan, not only the writes
An apply planned before taking the lease, so another apply could write between
its plan and its writes: the first then wrote half of itself and failed
(E_NAME_TAKEN, E_APPLY_STALE), or deleted a resource a workflow had just
started using, because its in-use check had run before the other apply's save.
A non-dry-run apply now takes the lease first and plans and writes under it, so
a second apply is refused SOURCE_BUSY before it reads anything. This replaces
the post-lease in-use re-scan, which covered only deletes. Dry runs still take
no lease; the per-write lease confirm and stored-fingerprint re-checks stay for
UI edits, which the lease does not order.
* fix(workspace-code): literal-secret findings carry a span but no code frame
E_MCP_LITERAL_SECRET, E_DEPLOY_SECRET, W_TOOL_LITERAL_SECRET and the workflow
W_LITERAL_SECRET framed the line holding the secret, echoing it over v2 and MCP.
They keep their span; the finding cap and the server locator drop the frame too.
* fix(workspace-source): a secret declared without a description records no base entry, so it is never falsely stale
* test(workflow-code): time hostile inputs with Date.now, repeated past the clock's resolution
The package has no Node or DOM types, so performance is not declared. Each
growth timing now repeats the work until it spans 25 ms, so millisecond steps
do not swing the ratio.
* fix(workspace-code): an env reference or helper call is never read as an object
headers: env.TOKEN parsed with no finding into a header named $env, and
defineTable(column.string()) reported the encoding's $call/args fields. Both
now get one finding that names the value and how to write the object.
* feat(workflow-code): mixed-script block names, workflow inputs, env hint target
- E_LOOKALIKE_NAME also refuses a block name with a word mixing Latin with
Cyrillic, Greek, Armenian or Cherokee letters (Unicode script property, no
confusables table), naming the code point; W_ when the block is stored.
- startInputs and INPUT_TRIGGER_TYPES (shared with apps/sim) read a workflow's
Start trigger inputs; W_CHILD_INPUT_UNKNOWN and W_CHILD_NO_START join the
vocabulary for the CLI's offline child-call check.
- CompileInput.envDeclaredIn points a W_ENV_UNKNOWN hint at secrets.ts.
* feat(sim-cli): workspaces source check covers skills, child inputs and workspace.d.ts
- skill('<key>') is checked against skills/ like every other kind; a key with
a non-ASCII letter names its code point and script.
- A child workflow call is checked against the child's Start trigger in the
same directory (W_CHILD_INPUT_UNKNOWN, raised on new blocks; W_CHILD_NO_START).
- A get keeps the server's resource manifest beside workspace.d.ts, and check
regenerates workspace.d.ts from it and the directory's declarations, typing
new keys and each workflow's inputs without a request.
- Did-you-mean hints on E_MAT_UNKNOWN_RESOURCE, W_TABLE_UNKNOWN_COLUMN and
W_ENV_UNKNOWN (which points at secrets.ts); a warning raised to an error no
longer says it is kept as written.
- check --help lists every kind it checks.
* fix(workspace-code): check the option cap before a linear duplicate scan; pin a duplicate column to itself
A select's repeated-option scan was quadratic and ran before the maxOptions cap:
80k options took 7 s per parse (now ~0.1 s). E_TABLE_DUPLICATE_COLUMN spanned the
whole defineTable argument instead of the second column.
* perf(workspace-code): group a status's changed files in linear time; key server findings by code
localResourceChanges copied the kind's array per file: 40k files took 3.3 s.
SERVER_FINDINGS is now checked against WorkspaceDiagnosticCode.
* perf(workflow-code): print a fill in linear time by advancing an offset
printFill re-spread the remaining parts for every content/separator pair, so a
number-only array printed in quadratic time (40k numbers took 17.5 s). The rest
of the fill is now queued as the same parts from a later offset.
* fix(workflow-code): refuse a tool param or operation option the builder pins
A tool builder's fixed params and the operation option overwrote the method's
pin silently, so the tool stored an operation the method contradicts and printed
back as raw(). Report E_FIXED_PARAM, as the block path does.
* refactor(workflow-code): look a tool's builder up once
toolBuilderPath found the builder, returned its path, and compileToolCall looked
it up again behind an early return that could not fire.
* fix(workspace-code): cap knowledge document findings apart from knowledge.ts's own
Document findings were uncapped and counted against the field reporter's
100-finding budget, so the declaration's own findings became E_LIMIT_EXCEEDED.
The field reporter now counts only what it appends.
* fix(workspace-source): a workflow delete is fingerprinted only once its live triggers are counted
* fix(workflow-code): exclude a retyped block from rename inference by its own id
A retype matched by lock ident (or against a prev block the canvas renamed)
excluded the prev block under the new key, not the one it retyped, so another
new block of the old type could inherit the old id, its run history and its
webhook. Record the retyped prev id and exclude that.
* fix(workspaces): a key claim that loses a concurrent race refuses with 409 or retries, never a raw 23505
claimResourceKey read the key with select-for-update, but an unheld key has no row to lock, so a
concurrent get (allocation) or claim could insert first and the plain insert failed with a unique
violation on either index, surfacing as a 500. The insert now skips on conflict and the claim
re-reads the committed winner: kept, ResourceKeyTakenError, or a retry that replaces a key the
resource was allocated meanwhile. Rebinding deletes and re-inserts so it shares the same path.
* perf(workflow-code): push identity group keys instead of re-spreading the group
Each push copied the whole group, quadratic when many unmatched blocks share a
type and parent.
* fix(workflow-sdk): new on a runtime export throws SimSdkNotExecutable; one stub for both entries
The Proxy target was an arrow function, which has no [[Construct]], so the
construct trap never ran and new t() threw a TypeError. The workspace runtime
re-declared notExecutable and seven identical functions; both entries now share
the stub in not-executable.ts.
* feat(workflow-code): x.error compiles in the handler of an onError edge
The executor returns { error: <message> } as a failed block's output when an
error edge leaves it (BlockExecutor errorOutput, block-executor.ts:738-740,
returned at :868-877). Compile accepted no such path, so the INDEX promise of
${x.error} failed with W_UNKNOWN_OUTPUT_PATH. Now x.error checks once the edges
are known: accepted with an error edge, refused with a hint to wire onError
without one. Block<O> types error in the SDK, INDEX says how the handler reads
it, and the integrations cookbook shows it.
* fix(workflow-code): compile stored() in a loop or parallel's meta.extra
The printer writes a container param holding a detected credential as stored()
under meta.extra, but compileContainer passed no keep callback, so the print
failed to compile. Keep the stored value as a regular block's extra does.
* fix(workflow-sdk): never embed a dotfile from the cookbook
WORKSPACE_COOKBOOK embedded every file on disk under cookbook/workspace, so a
.DS_Store or editor swap file would be written into every user's example
directory. The listing now lives in embedded-files.ts, shared with the drift test.
* docs(knowledge): say why an upload's processing relay is safe on every surface
* perf(workflow-code): read each node's successors once in the cycle check
stronglyConnected called successors on every step of a frame, and the caller
maps the node's whole outgoing list each time, so a block wired to many targets
cost O(deg^2). Read them once when the frame is pushed.
* perf(workflow-code): test a restored inactive value with withStoredValue
staysInactiveWithPrev rebuilt the block's whole activity inputs (every param,
the modes, the ids deploy reads) for each inactive id on each pass. Build them
once per pass and swap the one value in, tracking the pass's restores.
* fix(workflow-code): keep collapsed on inputFormat fields whose id stays inline
Canonicalize drops the editor's collapsed flag from every field, but materialize
restored it only for fields whose id moved to the lock, so a field with a shared
or missing name lost it whenever the list changed.
* feat(sim-cli): no login exits 13 with AUTH_REQUIRED
Not logged in, an OAuth login that expired and cannot refresh, and a 401 from
the server exited 1 with CLI_ERROR, the same as a source with errors. They now
exit 13 (AUTH_REQUIRED_EXIT_CODE) with the code AUTH_REQUIRED (a 401 keeps the
server's code when it sends one). A status still falls back to the local view
without a login, and its note now reads as sentences.
* fix(workflow-code): write a subflow collection holding a $sim object back unwrapped
Canonicalize and compile wrap an object with its own $sim key as a literal node,
but materialize wrote forEachItems and distribution raw into block.data and the
loops and parallels maps, so after any config change the executor iterated the
wrappers. Unwrap literal nodes there, and say so in jsonField's TSDoc.
* fix(sim-cli): source diff filters resolve against --dir; cancellation and 413 keep their exit
- diff ./, an absolute path or a path from the current directory selected
nothing and printed "No local changes."; filters now resolve against --dir and
one that selects no file is refused (SOURCE_PATH_UNMATCHED).
- A cancelled request carries REQUEST_CANCELLED, so status no longer reports it
as an unreachable server; noAnswer() is the one copy of that predicate.
- workflows/workspaces source status and diff map a 413 to exit 7, as get does.
* fix(workspace-source): holding a change for one credential key keeps another key's unreachable refusal
* fix(sim-cli): an apply drops the written.json entries of the resources it deleted
The record kept every deleted resource's files, so status reported the delete
forever (exit 11) and recreating the key made get refuse with SOURCE_LOCAL_EDITS.
An entry is dropped only when its file is gone and the returned base no longer
holds the resource or blob, so a held or failed delete stays retryable.
* fix(workspace-source): a chat auth type source cannot name leaves the deployment out instead of reading as public
* perf(workflow-code): bucket wiring and order dependencies by scope once per print
Each scope's wiring rescanned the members of every enclosing scope and refiltered
their edges by edgeScope, and each scope's declaration order was handed every
dependency in the workflow: O(scopes x blocks). Bucket edges by the scope they
print in, and dependencies by the scope they order, in one pass.
* fix(workspace-source): file creates of one name check every key they may take, and a lost key claim refuses the create
* perf(workflow-code): memoize buildFieldIndex and group pair members in one pass
The index was rebuilt for every block in print and compile and for every tool,
and each canonical pair rescanned every subBlock for its members: O(pairs x
subBlocks) per call. Group the members once, and memoize the read-only index by
block, trigger mode and pinned ids.
* refactor(workflow-code): sort compiled edges with canonicalize's compareEdges
Compile kept its own copy of the comparator, and the CWM edge order is hashed
(canonicalHash), so two copies could drift.
* chore(workspace-source): unexport WorkspaceSourceChange, used only in its own file
* docs(workflow-code): move compileRegularBlock's TSDoc onto it
It sat above BlockShape's own TSDoc, documenting nothing.
* fix(workspace-source): the staging sweep removes objects before their rows, keeping a row whose object survived
* docs(workflow-code): describe LoopSpec as canonicalize reads it
The TSDoc said the spec is the loops map's config and that canonicalize never
fills defaults; loopSpec reads block.data first, never takes the map's count,
and falls back to a for loop of 5.
* refactor(workflow-code): stop exporting ConfigItem
Nothing imports it; it is only printedConfig's item type.
* refactor(workflow-code): read pinned values and the catalog block once
compileMetaParams rebuilt the map of every stored value once per pinned id, and
needsTodo looked the catalog block up twice though collectParams already holds it.
* fix(table): a reshape resolves each column update to its id, so a by-name swap renames both
* fix(workspace-source): a get leaves out a secret named __proto__ instead of printing an unapplyable secrets.ts
secrets.ts printed every stored secret, but the declaration reader refuses a
__proto__ key, so after a get the whole file stopped applying. The secret is
now listed in skipped.json with the reason; MCP header names the reader refuses
already round-trip-fail into skipped.
* perf(sim-cli): a status past one dry run prunes its whole read instead of walking the directory again
When the workflow folders exceed one dry run, status read the directory a
second time: a second walk, read and hash of every file. It now prunes the
unchanged folders from the read it already made.
* perf(sim-cli): workspaces source apply walks the directory once, inside its lock
assertWorkspaceDir walked every kind folder outside the lock before
readWorkspaceDir walked it again; the apply now checks the read it made and
runs the full check only to refuse. orphanedWorkflowFiles groups the answer's
paths by folder once instead of per lock, assertBaseWorkspace reuses
baseWorkspaceOf, and printPlan no longer shadows counts.
* fix(sim-cli): --only reads past an empty segment instead of refusing an unnamed kind
* refactor(workspace-code): un-export four unused types, name the skill locator apart from a line's offset, fix two TSDocs
* feat(workspace-source): an existing column becomes required in the same apply as the managed rows that fill it
* perf(workspace-source): list MCP servers' tools concurrently while planning tool references
* perf(workflows): a batched source read prints its workflows concurrently
* fix(workflow-types): hold a container's edges to the handle they leave from
A loop or parallel's start handle connects only into the container, and any other
handle never does. The shared scope rule ignored the handle, so the editing engine
kept a start edge to a block extracted from the loop (and an end edge to a block
moved into it): edges the canvas never draws and workflow source refuses
(E_EDGE_SCOPE), so such a workflow could not be applied back from its own source.
* fix(editing): refuse an error edge from a block with no error output
The engine accepted an 'error' handle on any block, so a trigger or a loop or
parallel container could store an error edge the canvas has no port for and
source cannot write (E_ERROR_PORT_UNSUPPORTED). It now follows the source
catalog's errorPort rule.
* fix(editing): normalize row ids only on fields declared as row lists
Row-id normalization keyed on the subblock id alone, so any field that shares an
id with a table field (supabase's JSON code 'params', 'metrics', 'headers',
'variables') was coerced to a row list: a JSON object or code text was replaced
by [] and the value lost. It now applies only where the block declares the id as
a row-list type.
* fix(workflow-code): keep the pair member a trigger-mode pair's mode does not select
Deploy reads every member of a trigger-mode pair, so the inactive-param restore
never brought back the member the mode does not select. An unchanged apply of a
block toggled into trigger mode dropped that member's stored value, and editing
the selected member dropped the other one. The pair's value is now its
mode-selected member's, and the other members keep their stored values, as on
the canvas.
* fix(workflow-code): write only the subflow config fields an edit changes
Canonicalize fills a loop's count (5) and the collection and conditions the
subflow map holds when block.data omits them; a changed config wrote all of them
back, so renaming the block a loop condition reads also stored count, collection
and condition fields nobody edited. Fields equal to the stored config keep their
stored spelling, absence included.
* fix(workflow-source): compile a block renamed in source against the block it continues
Compile matched the stored block by key, while materialize keeps a renamed
block's id through its ident (lock-ident). Renaming a block in source therefore
refused its stored() secret (E_STORED_VALUE_MISSING), turned a stored cycle into
E_EDGE_CYCLE, and reset fields source never writes (a note's color) to their
defaults. compileSource re-keys the stored model to the source's renames and
compiles again.
* refactor(sim-cli): name what source helpers do and fix their docs
- mergedGitattributes merges .gitignore too: withMissingLines.
- isMissing reads the code through errorCode, not a cast.
- workflows source check calls workspaceFolderOf directly.
- Exit codes 5, 6 and 7 document workspaces source as well.
- workflows source resources lists MCP servers; any source get writes it.
- Two TSDocs a reflow mangled.
* perf(workflow-persistence): read only live in-workspace graph rows in a batch load
loadWorkflowsFromNormalizedTablesRaw read every block, edge and subflow row of every requested id,
then dropped the ones outside the workspace, and kept archived workflows the read snapshot
discarded afterwards. Each graph query now filters by the live in-workspace ids as a subquery.
Measured on 100 live + 300 archived workflows of 30 blocks: loadWorkflowReadSnapshots median
579ms -> 151ms.
* perf(workflows): one credential lookup for a batch load's block migrations
loadWorkflowsFromNormalizedTables ran each workflow's block migrations serially inside the
REPEATABLE READ snapshot, and the credential-id migration queried once per workflow holding a
legacy account id. The batch now prefetches the credential ids for every workflow's legacy ids in
one query, and only queries again for an id a migration surfaces that the prefetch did not ask
about, so the result is unchanged: N serial round trips become one.
* fix(api): one ETag revalidation path; tagged v2 bodies are revalidated, and cached per request
- ifNoneMatchSatisfied was copied in the internal and v2 JSON builders; definition.ts now owns
entityTagMatches and notModifiedResponse.
- The v2 builder answered a tagged 200 and its 304 with private, no-store, which forbids keeping
the body the ETag exists to revalidate. Both now say private, no-cache, as the internal one did.
- The v2 validated-body LRU was keyed by the tag alone and served across principals and inputs,
though present() reads the parsed request. It is keyed by tag and parsed request now, and
entityTag documents that it must be a strong validator of the result for every caller.
- The internal builder's HEAD branch re-checked a missing authorize() that definition-time
validation already refuses; it captures the authorize phase once instead.
* fix(workflow-sdk): codegen uses its layout helpers; INDEX.md lists legacy builders only when there are some
- generate.ts builds block, models and index paths from layout.ts; blockTypesFile
leaves the barrel; layout.ts reads TOOL_NAMESPACE.
- @when names both fields of an and clause.
- typecheckSdkDirectory spreads SOURCE_COMPILER_OPTIONS.
- The cookbook declares ORDERS_API_KEY, which its tool reads, and says a new
query string updates an MCP server in place; column.ttl() says one per table.
- Doc fixes: arrayOf, declaredBlockTypes order, core.d.ts names tsc.
* fix(schedules): a written zero is an invalid schedule field, not a missing one
The reason classifier read fields through getSubBlockValue (value || ''), so a numeric 0 counted
as empty. It now checks undefined, null and '' explicitly.
* docs(environment): state the non-empty invariant both env paths share
* chore(scripts): name the pure package an offender is in, not always workflow-code
* refactor(chat-deployments): one identifier-ownership check, and one live-chat read per replace pre-check
* refactor(workflows): the code tab names its directory with the shared slugify
* refactor: keep types no other module imports private
* refactor(workflows): drop the field-by-field source apply presenter
The response schema already strips the result's internal fields, so both routes present the
result as it is.
* refactor(workspace): the workflow-code flag is required of every flags producer
* refactor(utils): one mapWithConcurrency, with documented failure semantics
apps/sim had its own mapWithConcurrency next to @sim/utils/concurrency's, with different failure
semantics: it rejected through Promise.all as soon as one item failed while its other workers kept
starting items nobody awaited. Every caller now uses the @sim/utils one: after a failure no item
starts, and the first failure is thrown once the running items settle, so nothing the batch began
is still running when the caller handles it. mapSettledWithConcurrency (attempt every item, keep
each outcome) moves alongside it. createConcurrencyLimit, MATERIALIZE_CONCURRENCY and
waitWithAbort stay in apps/sim.
* perf(workspace-source): a knowledge plan never downloads a document named in neither the base nor the directory
* docs(workspace-code): CI commits back what apply rewrote, tsc step, Gmail provider
- The scripting.mdx CI job runs tsc after check (which regenerates
workspace.d.ts), and on merge commits back the files the apply rewrote, with
[skip ci] and contents: write; a protected branch opens a pull request instead.
- workspace-code.mdx says what check now covers (skills, child inputs, rows,
workspace.d.ts).
- The cookbook credentials.ts shows Gmail's provider id, google-email (the id
apps/sim/lib/oauth/oauth.ts registers for Gmail).
- The docs baseline records the changed CI fence.
* docs(cli): regenerate the CLI reference for the check help and exit 13
* test(api): the source catalog's tagged 200 is private, no-cache
* fix(workspace-source): a renamed or name-taken stored() tool reports only that, not a missing stored tool
* fix(workspace-source): a deleted chat's base no longer records its password variable
* fix(table): reshape audit entries name columns, never their ids
* refactor(workflows): drop the never-filled SourcePlan.notes, share the stale message, and read a rename's folder from the loaded workflow
* refactor(source): one managed-row key, one tool-input field list, and no unreachable fallbacks
* docs(source): gated manifest sections, the required-column 400, carried tags and the manifest limit
* chore(source): regenerate the v2 OpenAPI and MCP operations for the documentation changes
* test(workspace-code): bound the option-cap and status-grouping fixes by n vs 4n growth, not wall clock
The ratio helper is exported from @sim/workflow-code/scaling.test-helpers so
other packages' scaling tests share it.
* fix(workflow-code): x.error is a string in a JSON field
The executor's error output is the failure message, so a reference to it in a
JSON body (response, API body) is stored quoted, as compile and print decide
through refValueKind; bare, a message would break the JSON.
* refactor(workspace-code): rowKeyText reads any cell value, so the table row writer shares it
* chore: drop the apply wire type no module reads, and shrink the non-null baseline the batch load cleared
* test(workspace-source): the cookbook apply test holds the Gmail credential the cookbook declares
* fix(workflow-code): keep a stored field the printer left out as inactive
Compile fills an omitted param with its default, then keeps the stored value only
when the field is inactive, judged with the default in place. A standalone
advanced field runs once non-empty, so a stored '' choice (cloudflare's 'Active
only' certificate filter) read as active under the default and every apply
replaced it with 'all'. Inactivity is now judged with the stored value.
* refactor(utils): point the merged mapWithConcurrency callers at @sim/utils
* test(workflow-source): prove canvas, JSON API and source stay in lockstep
A seeded fuzz applies random sequences of real editing-engine operations (add,
delete, move, edit fields, connect, disconnect, insert into and extract from
loops and parallels, rename, enable, retype, trigger and advanced mode, loop
config, variables) to corpus workflows, then asserts the source of the result
applies back as a no-op and one random source edit changes exactly that field.
Failures shrink to a one-minimal edit list. Every registry block type is added
(or, for legacy and single-instance types, edited) with non-default values in
each subblock kind it has. Each divergence fixed on this branch keeps a minimal
regression. The integration suite runs the full stack on Postgres: JSON write,
editing operations, source get and apply, JSON read, and a canvas-built workflow
against the one created from its source.
* chore: drop exports the cell-rule move left unused; move the timezone baseline entry
* chore(audits): count staging's new integration double-cast in the merged ratchet
* test(workflow-source): satisfy the audits in the fidelity suites
* test(workspaces): wait with the shared sleep helper
* fix(cli): recover a command lock abandoned before its owner was recorded
The takeover claim inside the lock refreshed the lock folder's mtime before
the staleness re-check, so a lock with no owner.json never read as stale and
every command returned SOURCE_DIR_BUSY. Judge an unrecorded lock's age from
the sighting taken before the claim, and guard against a replacement lock by
checking the folder is still the one seen (dev/ino) and still stale.
* chore(helm): bump chart to 1.11.22 for the source-staging cleanup cron
* fix(workspace-source): match managed row keys after their column's coercion
planRows compared declared key cells with stored ones before coercing them,
so a number key written as "007" counted the stored row 7 as removed and the
apply refused without --allow-delete, though the keyed write coerces "007"
to 7 and matches it. Coerce the declared key with the key column's cell rule
(the reject policy a keyed write uses) before matching.
* fix(workflow-code): print a JSON code field in meta.extra as its stored text
An advanced JSON code field the serializer still forwards under an operation that
hides it prints under meta.extra, which compile reads verbatim. It printed as an
object literal, so compile stored a native object and an unchanged apply rewrote
the stored text (minified, or not at all equal when it held references). It now
prints as text there; only a builder param takes the literal form.
* fix(workflow-source): keep a block keyed __proto__ in the lock and hints
buildLockFromState, hintsFromSourceMeta and printStoredSource assigned by bracket,
so a block whose name normalizes to __proto__ set the prototype instead of an
entry: it vanished from the lock, and renaming it in source lost its identity
(compile treated it as new and reset its unwritten fields).
* test(workflow-source): regressions from the long fidelity run
A JSON field forwarded under a hiding operation, a block keyed __proto__, and the
by-design collision-key refusal the fuzz now leaves out.
* fix(cli): workspaces source status and diff refuse a directory holding no workspace source
A mistyped --dir, an empty directory, the wrong working directory (--dir
defaults to .) or a workflow folder read as clean: status exited 0 after a
dry run of no kinds, and diff printed "No local changes.". They now refuse
it with the reason and the get to run, as apply and check do.
* fix(cli): status recommends the get that restores a removed kind folder, not an apply
Removing a managed kind's folder or root file (tables/, secrets.ts) stops
managing the kind: an apply leaves its resources alone. status reported its
recorded files as deleted and recommended apply --yes, which wrote nothing, so
the next status said the same thing again (exit 11 forever) while get refused
to write the files back. When every local change is in such a kind, status now
recommends get --only <folders> --force, which restores them, and says how to
delete the resources instead.
* fix(utils): mapWithConcurrency throws the first failure in time
The shared helper threw the failure of the lowest-numbered slot, so a slow
slot-0 error masked an earlier one from another slot. The apps/sim helper it
replaced (Promise.all) threw the first failure, and the TSDoc still promises
that.
* fix(cli): workspace source commands handle a directory no one may write
Every workspace source command takes the directory's lock by creating
.sim/command.lock, so in a read-only checkout status, diff and apply --dry-run
crashed with a raw EACCES stack trace. Commands that only read (status, diff,
a dry run) now run without the lock there, since nothing can rewrite the
directory; get, check and apply are refused as SOURCE_DIR_UNWRITABLE with the
reason.
* fix(cli): status refuses a broken .sim/written.json instead of calling every file created
A merge conflict that leaves markers in .sim/written.json (two branches that
each applied) made status read every file as created and recommend an apply.
It now refuses with SOURCE_WRITTEN_INVALID and names the get that rewrites the
record. A broken .sim/base.json names its way out too (SOURCE_BASE_INVALID).
* docs(cli): status and diff help name exit 7, and the workflow guide exit 13
status and diff exit 7 when the server refuses the source as too large (413),
as exit-codes.ts documents, but their help listed only 0, 11, 12 and 1. The
workflow directory's .sim/AGENTS.md now names exit 13 (not logged in) as the
workspace guide does. CLI docs regenerated.
* fix(executor): splice already-escaped values into JSON strings as written
Escaping every reference landing inside a JSON string literal fixed values that
broke the JSON (quotes, newlines, stray backslashes), but it also re-escaped
values that were already valid string content. A deployed workflow whose env
var holds a key with literal \n escapes, or that escaped a value in a Function
block to work around the old bug, now sent backslash-n instead of a newline.
Only a value that would break the literal is escaped now; one that is already
valid string content splices raw, exactly as before.
* fix(table): write every row's cancellation when one write fails
cancelWorkflowGroupRuns cancels every row's queued jobs, then writes each row's
cancelled status. The shared mapWithConcurrency starts nothing after a failure,
so one failed write left the later rows of the page 'running' with no job behind
them; the apps/sim helper it replaced still wrote them. The writes now all
settle before the first failure is thrown.
* fix(cli): count a workflow changed only on the server as unchanged in workspace status
The status dry run sends every workflow folder whole to detect drift, so the server plans an
update for a folder edited only in Sim. An apply sends that folder by its base and leaves it
unchanged, so the status plan line said 'Applying would: 1 update' for an apply that changes
nothing.
* fix(cli): an interrupted source command releases the directory lock
Ctrl-C during a workspace source command left .sim/command.lock behind. A
later command takes a lock over only when its owner ran on the same host, so
one left in a folder shared with a dev container or another machine stayed
until removed by hand (exit 10 every time). The lock is now removed on
SIGINT/SIGTERM before the signal ends the process, as a staged write's folder
already is.
* test(workspace-source): a key-claim failure trigger left by a killed run no longer breaks the next one
* fix(e2e): expire the workflow source e2e session in UTC
session.expires_at is a timestamp without a zone that the app reads as UTC. now() writes the
database's local time, so on a Postgres west of UTC the one-hour session was already expired
and the canvas-route check got 401.
* fix(cli): get keeps a directory bound to its workspace when its base does not parse
get decided which workspace a directory belongs to only from a base that
parsed cleanly, so one this CLI refuses (a field a later CLI added, a bad
fingerprint) read as no base: get then used the profile's workspace, and
--workspace naming another one was not refused (SOURCE_OTHER_WORKSPACE). It now
reads workspaceId as leniently as apply and status do.
* fix(cli): print nested source apply results as JSON in text output
`sim workflows source apply --output text` printed the modified blocks as
`modified [object Object]`.
* test(workflow-code): alternate small and large runs in the growth check so machine load slows both sides
* fix(workspace-source): in-use scan reads the live deployment version
A delete of a resource that a deployed workflow's live version still uses,
while its draft no longer does, now warns W_RESOURCE_IN_USE naming the
live version, unless the same apply publishes the draft or undeploys it.
* fix(workspace-source): class a refused apply by the errors that refuse it
The rejected error counted and classed every error, including those of
changes the plan holds back, which refuse nothing. The plan now returns
the refusing errors (plan-level plus non-held changes) and the error
classes from those.
* fix(workspace-source): a key taken after a committed write reports the write
A key claim that found the key held by another live resource after the
write committed threw, dropping the written resource from applied. write()
now returns it with E_NAME_TAKEN; the apply records it as applied, keeps
the base entry unchanged, and stops so no later write resolves the key to
the other resource.
* test(workspace-source): per-process source slot refuses past its cap with 429
* fix(cli): check table row columns when the row holds a non-string reference
Compiled row data stores a non-string reference bare ("n": <score.value>), which JSON.parse
refuses, so check skipped the whole row: an unknown column or select option in any row writing a
number, boolean or object output went unreported. Parse it as a JSON field instead.
* feat(workflow-code): hint api for http.request and fn for javascript.* builders
An agent guessing the HTTP request block as http.request got E_UNKNOWN_BUILDER with no hint:
no edit distance reaches api.
* docs(workflow-code): correct workspace-key, rows, written.json and create claims; fill agent-guide gaps
- credentials bind with a workspace API key; secrets and deployments do not (guide, CI docs, API description)
- table rows are source when a table opts in; list rows.jsonl and the limits
- .sim/written.json is committed, not gitignored; drop stale tsc sizes; exit 9
- a created-not-yet directory has no base: create --dry-run, not status
- guide: api is the HTTP block, W_* print as error in check, self-hosted apiKey, promote setup
* test(workspace-source): a key-claim failure trigger left by a killed run no longer breaks the next one
* test(workflow-code): alternate small and large runs in the growth check so machine load slows both sides
* test(workflow-code): time the block-cap round trip by thread CPU, so machine load cannot fail it
* fix(workflow-code): never print a credential through the response body form
The response(name, { body, status, headers }) form printed its fields'
stored values verbatim, so a response block holding a detected credential
(an Authorization header, a token in the body) printed the secret into the
file while W_LITERAL_SECRET claimed it printed as stored(). Such a block now
keeps its own params, where the field prints as stored(), and compile warns
W_LITERAL_SECRET when source writes one in the form.
* fix(workflow-code): check agent tool calls the way blocks are checked
compileToolCall accepted any builder as a tool (api.tool, condition.tool,
trigger.gmail.tool.poller), stored any param key unchecked, and never warned
about a literal secret, though print writes these tools as raw(tool) and
warns W_LITERAL_SECRET. A tool call now needs a builder with a tool form
(E_UNKNOWN_BUILDER), each param must be one its tool type declares
(E_UNKNOWN_PARAM with a did-you-mean, W_FIELD_NOT_APPLICABLE for another
operation's), and a literal secret warns as on a block.
SYNTAX.md and core.d.ts no longer document agent.tool() or
runWorkflow.tool(): neither is typed, and print writes such tools as
raw(tool).
* fix(workflow-code): refuse stored() and codeFile() in a loop or parallel config
compileConfig dropped any config value that was not a plain value, so
loop.forEach('L', { collection: stored() }) or a codeFile() condition
compiled silently to a loop with no collection or condition. Both are now
E_UNSUPPORTED_SYNTAX with the form to write instead.
* fix(workflow-code): give every compile finding a hint that names its fix
E_TARGET_TRIGGER, E_ERROR_PORT_UNSUPPORTED (a loop or parallel has none:
wire onError from its children), E_UNKNOWN_BRANCH in meta.branches (lists
the branches), W_VALUE_KIND (the literal form the field takes) and
E_UNKNOWN_IDENTIFIER for undefined, NaN and Infinity had no hint. The test
catalog's loop and parallel now have no error port, like the real catalog.
* fix(table): keep batch rows that keep a unique value in the DB check
batchUpdateRows excluded every batch row from each unique column's DB check and
compared the rest by the values it read before taking the value locks. A row the
batch leaves alone could take the value from a concurrent edit after that read,
so both it and the batch's writer stored the same unique value. Each column's DB
check now skips only the batch rows that rewrite that column.
* docs(tables): say add-column refuses a required column rows leave empty
* fix(cli): Ctrl-C during an apply write names what it may have done
An interrupt while the apply request was in flight exited 130 silently, so
nobody learned the write may have landed. The lock's interrupt handler (which
already releases the lock) now prints the same next step a lost answer gets,
then ends with the signal.
* fix(cli): a status without a login recommends sim login
With no login on the profile, status shows the local view (the server is
treated as unreachable) and its note says to log in, but next was
apply --dry-run, which only exits 13. next is now the login, then status again,
for workflows and workspaces alike.
* fix(cli): check offline with no cached catalog names the get that caches it
A fresh clone checked while the server could not be reached failed with the
raw "Could not reach …" and no next step. It is now CATALOG_NOT_CACHED (exit
1) naming sim workspaces source get, as a check with no credentials already
is; no login keeps its AUTH_REQUIRED refusal (exit 13, naming sim login).
* fix(workflow-code): keep meta.retry within the bounds the loader pins it to
Persistence saves a retry policy verbatim but loads it clamped (2-5 tries,
0-5000 ms, whole numbers), and canonicalize kept a well-formed policy raw.
A file writing maxTries: 10 stored 10, read back as 5, and every re-apply
of the unchanged file showed a retry change. Compile now refuses an
out-of-range policy with a hint naming the bounds, and canonicalize pins
the numbers as the loader does, so a printed policy always compiles back
unchanged.
* Revert "fix(workflow-types): hold a container's edges to the handle they leave from"
This reverts commit
|
||
|
|
8ea9ffc07b |
feat(mcp): add code mode to the Sim MCP server (#10204)
* feat(mcp): add code mode to the Sim MCP server * fix(mcp): stop queued code-mode calls at run end, bound error output, and type union bodies * fix(mcp): render closed empty objects as Record<string, never> * fix(mcp): render tuples and open objects in generated contract types |
||
|
|
cda94995e5 |
feat(usage): serve organization activity from an hourly rollup (#10200)
* feat(usage): serve organization activity from an hourly rollup * fix(usage): type the rollup marking hook, bump the chart version * fix(usage): address review: replica lag, retention marks, deferred chats, bounded housekeeping * fix(usage): measure replica lag with the pass's own lease as heartbeat |
||
|
|
ad8ff86014 |
feat(search): manage sources and permission uploads through the CLI (#10197)
* feat(search): manage sources and permission uploads through the CLI * fix(search): align source operations and complete CLI imports * fix(cli): preserve upload errors and support early Node 20 * fix(cli): retain structured upload errors and retry guidance |
||
|
|
bc48d10a68 |
fix(integrations): close follow-ups from the integration validation audits (#10183)
* fix(integrations): close follow-ups from the integration validation audits * fix(integrations): type the polymarket activity test params * fix(integrations): stub fetch for every spotify library test * fix(integrations): migrate kalshi create and amend to the v2 order api, address review * fix(integrations): keep the kalshi book-side helper module-private * fix(integrations): route kalshi cancels by ticker and harden the read-first order writes * fix(integrations): keep every legacy kalshi order key on v1 write outputs |
||
|
|
dcc536973e |
fix(integrations): validate polymarket, kalshi, sftp, ssh, smtp, jupyter and temporal (#10181)
* fix(integrations): validate polymarket, kalshi, sftp, ssh, smtp, jupyter and temporal * fix(integrations): honor negative position filters, type the new tests, and prove STARTTLS against a real SMTP server * fix(sftp): decode each escape run once and join upload names without decoding again * fix(sftp): reject a trailing parent segment in remote paths * fix(integrations): ignore null and empty timestamps in Kalshi settlements and Polymarket activity * fix(polymarket): reject a non-numeric activity timestamp and keep start=0 as full history * fix(polymarket): mark the next-page cursor output nullable * chore(integrations): regenerate artifacts after rebase |
||
|
|
1997d0a1a5 |
fix(integrations): validate spotify, buffer (#10175)
* fix(integrations): validate spotify, buffer * fix(integrations): cap spotify playlist items limit at 50 and drop buffer tests for rejected output enums * fix(integrations): keep spotify get playlist tracks on the read endpoint that serves any public playlist * fix(integrations): batch spotify library requests up to each tool's old id limit, restore playlist tracks limit, list new buffer channel actions * fix(integrations): honor cancellation in later spotify library batches, report the exact rejected id range, reject unknown follow types * fix(integrations): reject spotify uris of another type, fail on invalid library check chunks, describe partial batch failures * chore(integrations): regenerate artifacts after rebase |
||
|
|
a24b401b45 |
fix(integrations): validate ashby (#10167)
* fix(integrations): validate ashby * fix(integrations): type the ashby test helpers against the tool's own params * fix(integrations): send ashby get_job's flag only when it is a boolean and shrink the test-types baseline |
||
|
|
41b11cd4f8 |
fix(gitlab): scale group discovery and permission-aware search (#10138)
* fix(gitlab): scale group discovery and permission-aware search * fix(gitlab): validate combined permission uploads before saving * fix(gitlab): clarify byte limits and use browser file fixtures |
||
|
|
7e7a0c82ba | fix(ci): restore ESM checks and synchronize docs searches (#10139) | ||
|
|
d54ce94e95 | improvement(ci): reuse bounded compiler state for acceptance builds (#10127) | ||
|
|
9a8b002d70 |
improvement(ci): scope reviewed root audits to their checks (#10121)
* improvement(ci): scope reviewed root audits to their checks * chore(ci): clarify audit-only runner allocation |
||
|
|
165c3db6ec |
fix(library): attribute sim counts by clause and table row, not capitalized words (#10115)
* fix(library): attribute sim counts by clause and table row, not capitalized words * fix(library): handle colon lists, parenthetical comparisons, relative clauses, prefixes, and linked names in sim-count * fix(library): keep sim relative clauses attached, anchor parenthetical comparisons to sim, and detect pipe-less table rows * fix(library): remove sim-count comparison asides for any subject and keep counted openers * fix(library): keep sim-count comparison spans inside their sentence * refactor(library): read sim-count comparisons as their own clauses instead of deleting them * fix(library): split sim-count contrasts nested in comparisons, keep count lists together, and end sentences before closing quotes * fix(library): start sim-count clauses only at a new capitalized subject and tell count lists from new clauses * fix(library): check sim claims in feature-first table cells and treat digit product names as new subjects * docs(library): describe sim-count table cells and new-subject clauses accurately |
||
|
|
9b8d72d10c |
improvement(library): check sim's integration counts against the catalog (#10113)
* improvement(library): hold sim's integration, action, and trigger counts to the catalog in check:library-content * fix(library): match bold and title-cased sim counts, and track code fences by length |
||
|
|
77ce46129a |
fix(resume): capture pause block names and keep the resume page off the execution snapshot (#10104)
* fix(resume): stop shipping the execution snapshot to the resume page * improvement(resume): capture pause block names at pause time and keep display reads off the snapshot |
||
|
|
1dc07deea6 |
fix(integrations): validate dynamics 365, zoho desk, rippling, okta, sailpoint and snowflake (#10072)
* fix(integrations): sweep2 v2 — read the mapper operation from the tool-call context and validate integrations against vendor specs * chore: regenerate tool metadata, docs and ratchet baselines * refactor: simplify and clean up the sweep changes * fix(integrations): address review on dynamics 365, okta, rippling, zoho desk and snowflake - dynamics 365: blank canvas Outcome falls back to won - okta: list_user_groups pages with after/limit and returns nextCursor/hasMore - rippling: nextCursor output inlined (nullable) so docs list it; create record rejects blank data; cursor placeholder names the query cursor - zoho desk: restore sharedDepartments maxItems 10 on update_ticket - test types: narrow the okta url builder and snowflake mapper in new tests * fix(okta): mark list_user_groups nullable group fields as nullable * chore: regenerate tool metadata and mapper baseline after rebase * fix(microsoft-dynamics-365): render owner type and id on agent tool rows List Owners and Assign Record read ownerType/ownerId, which are block-only fields a tool row never rendered or stored, so every agent, Pi and HITL call failed with 'Owner type is required'. Mark both user-only so rows store them; canvas behavior is unchanged. * chore: regenerate tool metadata after rebase * fix(microsoft-dynamics-365): keep a blank close outcome failing instead of assuming won * chore: regenerate tool metadata and mapper baseline after merging staging |
||
|
|
5729416ca6 |
fix(blocks): read the mapper operation from the tool-call context in j–z blocks (#10078)
* fix(integrations): sweep2 m4 — read the mapper operation from the tool-call context and validate integrations against vendor specs * chore: regenerate tool metadata, docs and ratchet baselines * refactor: simplify and clean up the sweep changes * fix(blocks): type the sweep2 m4 mapper tests and stripe JSON spreads for test-types * fix(rocketlane): send only the saved time source when a tool call also names another * chore: regenerate tool metadata and mapper baseline after merging staging |
||
|
|
a86f4c2e44 |
fix(blocks): read the mapper operation from the tool-call context in internal and a–i blocks (#10077)
* fix(integrations): sweep2 m3 — read the mapper operation from the tool-call context and validate integrations against vendor specs * chore: regenerate tool metadata, docs and ratchet baselines * refactor: simplify and clean up the sweep changes * fix(blocks): keep tool-row conflictTarget, parse affinity rank/winRate args, fix CI type and canonical-id checks Table upsert keeps a tool row's conflictTarget when conflictColumn is unset; affinity parses model rank/winRate through the same numeric validation; instantly treats a whitespace interestValue as empty on tool calls; file reads the model folderPath via its canonical folderRef; dub's mapper context is optional; buffer test typing; shrink the test-types baseline for ashby. * fix(blocks): fall back to model args for empty carousel media, blank share emails, and boolean enabled filters * chore: shrink the mapper-operation baseline after rebasing onto staging * fix(blocks): keep a numeric zero table limit and drop the model authType when disabling sharing * fix(blocks): send one folder target on File append/edit tool calls On a tool call the mapper result is spread over the merged row and model params, so a model folderPaths survived beside the row's folderPath (or the model's own folderPath) and the file contract refused the pair. Clear whichever folder arg the resolved target did not set. * chore: regenerate tool metadata and mapper baseline after merging staging |
||
|
|
41c840c581 |
fix(blocks): read the mapper operation from the tool-call context in google, microsoft and atlassian blocks (#10076)
* fix(integrations): sweep2 m2 — read the mapper operation from the tool-call context and validate integrations against vendor specs * chore: regenerate tool metadata, docs and ratchet baselines * refactor: simplify and clean up the sweep changes * fix(integrations): resolve referenced files in the legacy slides image source and keep empty trello descriptions on tool calls * fix(trello): drop blank card descriptions again so a cleared saved field never erases one * chore: re-ratchet the mapper-operation baseline onto staging * chore: regenerate tool metadata and mapper baseline after merging staging |
||
|
|
2ed6201b7a |
fix(integrations): validate github, gitlab, linear, slack, pagerduty, incident.io, sentry and datadog (#10071)
* fix(integrations): sweep2 v1 — read the mapper operation from the tool-call context and validate integrations against vendor specs * chore: regenerate tool metadata, docs and ratchet baselines * fix(incidentio): keep the creator mapper module-private * refactor: simplify and clean up the sweep changes * fix(integrations): address v1 review findings and CI failures - keep the Linear project-status tool's display name so its docs anchor survives - pass Slack's comma-separated ID lists through the workflow-block mapper - reject '..' segments in GitHub content paths; only exact dot-segment GitLab ids - reject non-array commits in Sentry release create - mark nullable outputs (Linear dueDate/status, GitHub latest commit v2) - align descriptions with the vendor contracts (incident.io, Slack, GitHub, Linear) - drop a dead credential fallback the canonical-param check flags; fix test types * fix(integrations): keep latest-commit v2 docs, mark Linear project lifecycle timestamps nullable Inline the v2 commit output so the docs generator still documents it, and shrink the unused-exports baseline now that COMMIT_DATA_OUTPUT_PROPERTIES is imported. * chore: regenerate tool metadata and mapper baseline after rebase onto staging |
||
|
|
0ea25f479e |
fix(integrations): validate twilio, sendgrid, resend, mailgun, discord, telegram and whatsapp (#10073)
* fix(integrations): sweep2 v3 — read the mapper operation from the tool-call context and validate integrations against vendor specs * chore: regenerate tool metadata, docs and ratchet baselines * refactor: simplify and clean up the sweep changes * fix(integrations): address v3 review findings - twilio: trim account SID and From number once, mark sender/recipient outputs nullable, make From optional on the block when a Messaging Service is used - discord: truncate fractional limits, reject more than one message cursor, mark nullable outputs - telegram: only keep spoiler spans, drop NUL so input cannot alias a protected segment, mark optional animation fields, fall back to model poll options when the stored field is blank - resend: clamp list limit to 1-100, sentence covers segment or audience, nullable broadcast outputs - mailgun: clamp events limit to 300 - twilio voice: nextPageToken nullable - fix test-types errors in twilio and whatsapp tests * fix(integrations): clamp twilio voice page size, mark discord user avatar nullable * fix(discord): match get_user output nullability to the User object * chore: regenerate tool metadata and mapper-operation baseline after rebase |
||
|
|
c7abe25a67 |
fix(integrations): validate shopify, brex, ramp, zoom, calendly, cal.com, typeform, webflow and wordpress (#10074)
* fix(integrations): sweep2 v4 — read the mapper operation from the tool-call context and validate integrations against vendor specs * chore: regenerate tool metadata, docs and ratchet baselines * refactor: simplify and clean up the sweep changes * fix(integrations): address v4 review findings - wordpress: reject unparseable term IDs instead of dropping them, map date explicitly, type search ids as number | string - typeform: keep filename whitespace when building the file download URL - brex: reject a limit buffer percentage outside Brex's 0-100 integer range - calcom: type bookingUrl, hidden and ownerId on event type responses - tests: call tool builders through ToolConfig instead of a type assertion |
||
|
|
43aac9244b |
fix(blocks): read the mapper operation from the tool-call context in aws and infra blocks (#10075)
* fix(integrations): sweep2 m1 — read the mapper operation from the tool-call context and validate integrations against vendor specs * chore: regenerate tool metadata, docs and ratchet baselines * refactor: simplify and clean up the sweep changes * fix(blocks): keep model format, recursive and extended statistics on tool calls - tinybird append: fall back to the model's format before the csv default - sftp mkdir: fall back to the model's recursive before the default - cloudwatch get_metric_statistics: accept and normalize extendedStatistics from either source - azure data explorer ingest: an explicitly disabled Run in background stays off - cloudwatch/codepipeline tests: narrow the mapper so test-types passes |
||
|
|
41a5f38fd4 |
fix(blocks): read the mapper operation from the tool-call context and ratchet raw reads (#10070)
* fix(blocks): read the mapper operation from the tool-call context and ratchet raw reads A block's tools.config.params mapper gets the operation only as context.operation on a tool call (Agent tool rows, Pi, Human v2), so branches on params.operation take the no-operation path there. Add mapperOperation(params, context), move the mappers that already fell back to context onto it, and add check:mapper-operation, a per-file ratchet over the remaining raw reads (505 in 173 files) so they can only shrink. * fix(blocks): return an empty string from mapperOperation when no operation is set * fix(audits): track helper argument positions, destructured rests, helper results, and shadowed names in check:mapper-operation; drop _operation strips * fix(audits): refuse to raise the mapper-operation baseline and alias only helper results that carry their input * fix(audits): follow local copies when deciding whether a helper returns its params |
||
|
|
bc438fc0f8 |
fix(realtime): keep admin block locks out of write-role graph replaces (#10062)
* fix(realtime): keep admin block locks out of write-role graph replaces batch-add-blocks and replace-state (realtime) and every HTTP state-replace door wrote workflow_blocks.locked from the payload, so a write member could clear an admin-only lock and then edit or delete the block. A shared helper now keeps protected blocks, their incoming edges and loop config as stored during a full replace and writes every other block unlocked; batch-add skips protected blocks and blocks nested under a locked ancestor and never writes the lock flag. * fix(realtime): guard locked loop config and re-sync clients when locks win batch-add-blocks loops/parallels and subflow updates could rewrite a locked container's config. When persistence keeps lock-protected state over a payload, the room is told to reload instead of receiving the rejected payload. * fix(realtime): cascade orphaned locked children and keep preserved edge ids A replace that removes an unlocked container now removes its locked children too, matching a direct delete, instead of saving a dangling parentId. Preserved protected edges win by id, so a retargeted edge cannot duplicate one and abort the save. Skipped subflow updates re-sync the room like the other lock-reconciled writes. * fix(realtime): refuse whole pasted subtrees under a locked ancestor batch-add-blocks checks each added block against the graph as it will land, so a rejected container's new children and loop/parallel config are refused with it, and an edge refused for targeting a locked block re-syncs the room. |
||
|
|
77c9e26cee | improvement(egress): route workspace requests through the organization's egress gateway (#10040) | ||
|
|
4b4a78bc28 |
fix(files): keep Markdown tables readable while scrolling (#10041)
* fix(files): keep Markdown tables readable while scrolling * fix(files): track Markdown overlays during table scrolling * fix(files): contain wrapped inline code in WebKit * fix(files): preserve short Markdown table layout * fix(files): clean up Markdown fixtures after API failures |
||
|
|
e4d8673b27 |
fix(integrations): address release review findings on the integration sweep (#10039)
* fix(integrations): validate Asana limits, Intercom snooze times, and Mailchimp template ids, clamp Airtable page size, accept Mailchimp batch arrays, and keep the Mailchimp email type option on update * fix(integrations): resolve the tool-call operation in the QuickBooks, SAP Concur, Attio, Intercom, Notion, Box, and HubSpot mappers * refactor(integrations): share the Intercom params mapper, reuse the boolean and JSON input helpers, and drop duplicated test helpers * fix(mailchimp): leave the email type option unchanged when its stored value is null * fix(integrations): seed the Mailchimp email type option per operation and tighten presence checks for Intercom, Airtable, Dropbox, and QuickBooks inputs * fix(integrations): seed the Mailchimp email type option from the operation's first option and validate the Intercom ticket snooze on tool calls * fix(mailchimp): seed the email type option per operation, keep Keep current outside create, and default an unset create value to true * fix(integrations): lead the Intercom role and Pipedrive deal status with No change in agent tool rows * fix(integrations): parse the Mailchimp update email type option like create, drop its block-level required, and keep a zero Asana limit for validation * fix(asana): treat a whitespace-only limit field as blank on tool calls |
||
|
|
7246075ba2 |
fix(integrations): validate monday, asana, clickup, airtable, notion, supabase, amplitude, box, docusign, and dropbox (#10030)
* fix(monday): expose items_page cursor pagination on get items * fix(asana): send assignee/offset on task lists, add search limit, keep agent args in the block mapper * fix(clickup): keep model args on agent tool calls, add task date filters and lastPage * fix(airtable): accept already-parsed JSON inputs on tool calls and add list records pagination, page size, and view * fix(notion): split long text into 2000-char rich text objects and paginate read page content * fix(supabase): accept PostgREST-form and multi-column order-by, read primary/foreign keys from PostgREST OpenAPI markers * fix(amplitude): send the second segmentation group-by as a repeated g and add the e2 second event * fix(box): request the fields Box omits by default, add marker pagination for folder listings, keep the agent's folder name, and guard path ids * fix(docusign): page envelope and template lists, ignore missing signing anchors, and guard envelope path ids * fix(dropbox): read the nested existing shared link and page list folder and search with cursors * fix(integrations): keep per-operation pagination values from leaking across operations and keep blank canvas custom field values * fix(docusign): note that freeform signing can be disabled per account * chore(docs): regenerate integration docs, catalog, and tool metadata * chore(notion): replace non-null assertions in tests and shrink the explicit-any baseline * fix(integrations): fail loudly on partial Notion reads, validate Asana limits and assignee, accept cursor-only Dropbox paging, normalize Supabase order modifiers, and mark nullable pagination outputs * fix(box): mark nextMarker nullable |
||
|
|
56893cb622 |
fix(integrations): validate zendesk, pipedrive, and intercom against vendor specs (#10028)
* fix(zendesk): align search, merge, and bulk update requests with the Support API and expose missing block fields * fix(pipedrive): move activity writes and pipeline listing to API v2, send lead visible_to as a string, guard path ids * fix(intercom): snooze via the manage-conversation endpoint, coerce snoozed_until, guard path ids, add user/lead recipient types * fix(integrations): default Intercom message recipients to a documented type, accept boolean done on Pipedrive updates, keep the Pipedrive file_type output * chore(docs): regenerate integration docs, catalog, and tool metadata * chore(lint): shrink the explicit-any baseline * fix(integrations): keep quoted Zendesk search text, require org names on create, validate Intercom snooze timestamps, and tighten Pipedrive outputs * fix(intercom): label the message recipient id for users, leads, and contacts |
||
|
|
769e6cfb37 |
improvement(chat): show background task and scheduled job turns as messages (#10032)
* improvement(chat): show background task and scheduled job turns as messages * fix(chat): refresh automated turn workflow names and use shared label styles * chore(chat): shrink the text-size-literal baseline |
||
|
|
edb779961a | fix(knowledge,files): count knowledge base documents per base and index the modified-order file list (#10026) | ||
|
|
07330aed35 |
fix(blocks): keep agent-supplied tool args that block mappers remap from dedicated fields (#10006)
* fix(blocks): keep agent-supplied tool args that block mappers remap from dedicated fields * fix(blocks): gate every agent fallback on the call context, type the new mapper tests * chore(types): shrink test-types baseline for the fixed block tests |
||
|
|
cfc408321e |
improvement(executor): run the Agent block on the shared model-fallback walk (#9982)
* improvement(executor): run the Agent block on the shared model-fallback walk * fix(executor): type the agent test block log so the ratchet shrinks |
||
|
|
90f5b00a1a |
fix(docker): ship the realtime and migrations images with runtime dependencies only (#9983)
Bun's --omit=dev skips the root's devDependencies but still installs every workspace member, each member's devDependencies, and the optional peers the lockfile can satisfy. Both images therefore carried drizzle-kit (with its bundled esbuild binaries), vitest, vite and tsx, and the esbuild Go binaries account for nearly all of their HIGH/CRITICAL scanner findings. scripts/prune-production-workspace.ts narrows a turbo prune to the members the target reaches through dependencies, optionalDependencies or a tsconfig extends, and strips devDependencies from the root and the kept members. The migrations image gains a dev stage that keeps drizzle-kit for the dev environment's db:push; its final stage, which every other environment builds, runs db:migrate with runtime dependencies only. |
||
|
|
b266bd9822 |
fix(integrations): final review pass for the Atlassian and AWS sweeps (#9961)
* fix(atlassian): address final review Make Jira search heavy fields (ADF description, custom fields, attachments, links, subtasks) opt-in through fields, move transformIssueData into jira/utils, keep AQL order by splitting at parenthesis depth 0, let the object-types /flat fallback never add a failure, send next=true with Confluence search cursors, and harden Trello ID lists, Jira parent, and Confluence comment ids for agent calls. * fix(aws): address final review Share the optional-boolean parse through @sim/utils/coerce toBooleanFromInput, the IAM tags schema through iam-shared, and the SES message-tag schema through ses-shared. Accept SES email tags as a JSON string from agent calls, name the field on Secrets Manager JSON errors, accept JSON-array IAM tag strings and skip null tag values, and reject a JSON-object Textract query string. * fix(integrations): address review on the final pass Treat only a leading [ as a JSON Textract query list, reject JSON-array IAM tag strings and SES email-tag strings that do not parse to valid entries, name Secrets Manager tag JSON errors, restore the JSM list TSDoc placement, and shrink the explicit-any baseline after the Jira mapper move. * fix(integrations): reject JSON-object Textract queries only when they parse, keep null IAM tag values as empty * fix(textract): use isRecordLike for the JSON-object query check |
||
|
|
9866b65cd2 |
fix(atlassian): validate Jira, Confluence, JSM, Bitbucket, Trello against vendor docs (#9950)
* fix(atlassian): validate Jira, Confluence, JSM, Bitbucket, Trello against vendor docs
Fixes JSM Assets AQL search returning no objects (legacy request/response
shape), adds missing documented params and dropped response fields across the
suite, and routes path IDs through safeUrlPathSegment. All changes are additive:
no param, subBlock, operation, tool id, or output is removed or retyped.
* fix(atlassian): address review findings
Keep trailing AQL and CQL order by clauses after scoped filters, honor escaped
quotes, reject JSM approvalStatus/organizationId outside their ownership modes,
move Trello card outputs into types.ts so the docs render them, and drop the
now-unused Confluence COMMENTS_OUTPUT.
* fix(atlassian): send Trello update ID lists comma-separated and tighten output types
PUT /cards/{id} documents idLabels/idMembers as comma-separated strings.
Treat a whitespace-only Jira parent as unset, mark nullable Trello card
outputs, document the new Trello types, and type the Confluence search test.
* fix(trello): mark every optional card output field nullable
* fix(jira): keep explicit assignee ahead of customFields and accept string includeAttachments
|
||
|
|
143fe02872 |
fix(microsoft): validate Microsoft integrations, return dropped fields and expose missing params (#9949)
* fix(microsoft): validate Microsoft integrations, return dropped fields and expose missing params Sweeps Outlook, Teams, OneDrive, Word, SharePoint, Excel, Planner, Intune, Entra ID, Power BI, Dataverse, Dynamics 365, Azure DevOps, and Azure Data Explorer against the Microsoft API references. Outlook read/search and the Outlook trigger now return Bcc, Reply-To, internetMessageId, flags, and categories. All changes are additive: no param, subBlock, operation, tool id, or output is removed or retyped. * fix(microsoft): address review — Outlook poller retries, SharePoint filter guard, opt-in Entra manager * fix(microsoft): address review round 2 — Dataverse nextLink table binding, offboarding roles, SharePoint hidden filters * fix(microsoft): Teams Get Message sender falls back to bot name; clarify SharePoint site search scope * fix(microsoft): zero-drift fixes from verification — dedicated subBlock ids, restored legacy outputs and caps * fix(microsoft): reserve ADX table envelopes up front, log skipped Outlook attachments, tighten SharePoint upload path * fix(microsoft): shared toStringOrNull in AzDO mapper, null relations when unexpanded, per-file SharePoint name errors |
||
|
|
285727966b |
fix(google): validate Workspace integrations, return dropped fields and expose missing params (#9947)
* fix(google): validate Workspace integrations, return dropped fields and expose missing params Gmail read/search/thread/draft and the Gmail trigger now return Cc, Bcc, Reply-To, Message-ID, In-Reply-To, References, snippet, and internalDate. Sweeps Calendar, Meet, Drive, Docs, Sheets, Slides, Forms, Contacts, Tasks, Groups, and Vault against the Google API references. All changes are additive: no param, subBlock, operation, tool id, or output is removed or retyped. * fix(google): address review findings and CI audits - Vault shared drives use sharedDrivesOption; reject unprocessed scope outside Mail/Groups - Sheets: reject COLUMNS reads with a row filter, guard v1 spreadsheet ids, expose includeValuesInResponse on v2 writes - Groups list sends userKey exclusive of customer; Drive caps the metadata error body - Slides reads WordArt text and marks nullable outputs; Calendar validates raw reminder minutes and exposes the list time zone - Contacts rejects year 0000; Gmail labels output typed as json; audit and baseline fixes * chore(google): regenerate tool metadata after rebase * fix(google): tighten Docs tab/number parsing, normalize Slides soft breaks, reuse jsonResponse helper |
||
|
|
33734384d6 | feat(aws-marketplace): bill a listing's LLM usage to AWS through a per-period metering tally (#9921) | ||
|
|
ef7bc52246 |
feat(credentials): saved PostgreSQL, MySQL, and SQL Server connections (#9929)
* refactor(credentials): share the owner-scoped service-account secret read Oracle Database's saved-connection lookup now reads its row through one owner-scoped helper, so the saved database connections that follow bind to their owner and provider the same way instead of copying the query. * feat(credentials): saved PostgreSQL, MySQL, and SQL Server connections Adds three service-account providers (postgresql-, mysql-, and mssql-service-account) that store a database connection: host, port, database, login, password, and the SSL mode or SQL Server encrypt and trust-certificate settings. Saving proves the connection with SELECT 1 through each family's own query operation, so host validation and IP pinning match a real run, and only then encrypts it; driver errors are never surfaced. The connection is read back inside the tool operation, bound to the run's workspace or organization, by withSavedDatabaseConnection, which replaces every connection field in the call so a caller or model cannot steer a shared credential. One client-safe descriptor table drives the provider ids, required fields, provider catalog, token resolvers, secret builders, and a shared connect modal. * feat(database-tools): run PostgreSQL, MySQL, and SQL Server tools on a saved connection Every PostgreSQL, MySQL, and SQL Server tool now declares an optional service-account credential policy (required: false), so its inline connection fields keep working unchanged and a saved connection can stand in for them. The executor authorizes the selected credential and passes it through trusted context; the family's operation handler, wrapped by withSavedDatabaseConnection, reads the stored connection bound to the run's owner and replaces every connection field before parsing. The providers resolve inside the operation, like AWS, so they join OPERATION_RESOLVED_CREDENTIAL_PROVIDERS. A real-Postgres integration test saves a connection (SELECT 1 through the guarded path), refuses one the server rejects, runs a query on the saved connection whatever fields the call carries, and refuses it to another workspace and once revoked. * feat(blocks): credential-only PostgreSQL, MySQL, and SQL Server blocks postgresql_v2, mysql_v2, and mssql_v2 spread their legacy blocks and swap the connection fields (host, port, database, username, password, and SSL mode or SQL Server encrypt and trust-certificate settings) for a saved connection picker through withSavedCredential. Their canvas sentences drop the database clause the block no longer holds. The legacy blocks change only by hideFromToolbar and a legacy sunset pointing at the successor, so existing workflows keep their inline connection fields and run exactly as before. Generated block successors, docs, icon maps, and deployment metadata are regenerated. * docs(integrations): set up saved PostgreSQL, MySQL, and SQL Server connections Each page's intro now explains adding a saved connection, how Sim proves it before saving, what every SSL mode or SQL Server TLS setting does in the runtime's drivers, and that existing workflows keep their inline connection fields. * refactor(database-tools): wrap SQL families at registration and derive saved-connection schemas from the operations - Register the PostgreSQL, MySQL, and SQL Server families through registerSavedDatabaseFamily, which applies withSavedDatabaseConnection and records each tool id's service. A registry test now fails when a tool that names a saved database connection runs outside a wrapped family, the case the saved-credential contract skips for operation-resolved providers. - Build the stored connection schemas from each operation's own connection schema (bounds tightened, strict), so the TLS values and defaults have one source. Stored blobs decode exactly as before. - Reuse the SQL Server default connection timeout instead of repeating it, and parse a submitted connection once. - Unit tests prove save-then-run round trips and drive refusals through the run wrapper; the workspace and revocation cases stay in the integration test, which now runs through the registered operation. * fix(credentials): describe saved-connection TLS modes as the drivers apply them - MySQL Required verifies the certificate chain but not the host name (like VERIFY_CA), and both Preferred and Required refuse a server without TLS. - SQL Server Encrypt connection requests TLS; a server that does not support encryption gets an unencrypted session rather than an error. - PostgreSQL Preferred can be downgraded by an on-path attacker, so the hint and docs steer to Required when the server supports TLS. - Picker options are keyed by each operation schema's value type, so a mode the operations add or drop fails to compile instead of drifting. * refactor(credentials): derive stored database connection fields and credential-supplied params from one list The stored v1 schema now picks exactly the descriptor's login and TLS fields out of each operation schema instead of extending the whole schema, and the tools' credentialSuppliedParams come from the same list. An operation field added later can no longer change the stored blob, get pinned on every run, or stay visible on the credential-only block. * fix(credentials): validate the saved-connection port in the form and carry TLS tradeoffs into the provider catalog The connection modal now refuses a port that is not a whole number from 1 to 65535 and says so beside the field, instead of a generic verify failure. The v2 provider catalog hint for saved PostgreSQL, MySQL, and SQL Server connections now includes each transport-security field's tradeoff, so API callers see what Preferred, Encrypt, and Trust server certificate give up. The integration fixture decodes the database name from TEST_DATABASE_URL. * docs(credentials): document the database connection provider id helpers * fix(credentials): keep an encryption failure on a verified database connection a server error * docs(credentials): document the database connection descriptor and id types * docs(databases): describe the PostgreSQL, MySQL and SQL Server connection setting types |
||
|
|
ff166c1a56 |
feat(credentials): saved credentials for Amplitude, Kalshi, Splunk, CB Insights, Railway, and Qdrant; fix Kalshi Ed25519 signing (#9927)
* fix(kalshi): sign requests with Ed25519 keys, the type Kalshi generates by default Kalshi picks the verification algorithm from the registered public key: Ed25519 over the pre-sign text, or RSA-PSS SHA-256 for an RSA key. The signer always passed the sha256 digest and PSS padding, which Node and Bun refuse for an Ed25519 key, so every authenticated call with a default key failed before it was sent. The key type is now read from the parsed key (a PKCS#8 RSA key shares the Ed25519 PEM header), and any other key type is refused. * feat(amplitude): saved project credential and a credential-only Amplitude block An Amplitude credential holds a project's API key, secret key, and data residency region, verified by listing the project's events on the region's Dashboard REST host with the Basic key pair the tools send (Amplitude answers 403 for either key being invalid). The region and key shapes are checked before any request. Each tool group maps only the params it declares: analytics tools take both keys and the region, ingestion tools the API key and region, and User Profile the secret key. The legacy block keeps its inline keys and is hidden from the toolbar in favor of amplitude_v2. * feat(kalshi): saved API key credential and a credential-only Kalshi block A Kalshi credential holds an API key ID and its private key, verified by a free balance read signed the way the tools sign every authenticated call; a key that cannot sign or a key ID that would break the header is refused before any request. The tools that sign requests map the key ID and private key from the credential, while market data stays public, so kalshi_v3 shows the credential picker only on account and trading operations. Token credential fields gain an optional multiline flag so the connect form keeps a pasted PEM key's line breaks. kalshi and kalshi_v2 keep their inline keys and now point at kalshi_v3. * feat(splunk): saved authentication token credential and a credential-only Splunk block A Splunk credential holds an authentication token and the management URL, verified by reading authentication/current-context (documented, no capability needed) through the guarded egress with the URL normalized as the tools build it; an answer without a user context is not taken as proof, and certificate verification is never relaxed. The tools send the token whenever one is set, so the credential policy marks the inline username and password as replaced by the token: tokenCredentialOAuth gains an optional list of such params, and the saved-credential contract accepts any token-filled param (not only accessToken) beside them. splunk keeps its inline connection fields and points at splunk_v2. * feat(cbinsights): saved API client credential and a credential-only CB Insights block A CB Insights credential holds the client ID and secret, verified by exchanging them at POST /v2/authorize, the call the tools make before their first request; a success without a token is not taken as proof, and the error body is never logged. The tools keep minting and caching their own token per run, so the credential fills the same client ID and secret they take inline. The lookup's profileUrl is request data sent to api.cbinsights.com, recorded as such in the saved-credential contract. cbinsights keeps its inline client fields and points at cbinsights_v2. * chore(audits): shrink the unused-exports baseline for exports now in use The Kalshi signer is exercised by its tests and the CB Insights API base by the saved credential check, so neither is unused any more. * test(credentials): cover a token-replaced sign-in whose token fills a param other than accessToken The saved-credential contract now accepts any credentialParams entry filled with the token beside tokenReplacesParams (Splunk's authToken), and names that in its error. * feat(railway): saved token credential, type-aware, and a credential-only Railway block A Railway credential holds a token, its type (account, workspace, or project), and for a workspace token the workspace ID. Each type is verified with the read Railway documents for its scope, since `me` answers only an account token: an account token reads `me`, a workspace token reads its workspace by ID (passed as a GraphQL variable), and a project token reads `projectToken` with the Project-Access-Token header the tools send for it. A GraphQL error or a body without the queried object is not taken as proof. The tools receive the token and its type, so a project token keeps its own header. Token credential fields gain an optional flag: an optional field is left out of the required create fields, the connect form does not require it and omits it when blank, and the secret builder stores it only when set. Existing descriptors declare no optional field, so their required fields and stored secrets are unchanged. railway keeps its inline token and points at railway_v2. * feat(qdrant): saved API key credential bound to its instance URL, and a credential-only Qdrant block A Qdrant credential holds a database API key and the instance URL, verified by listing collections (a read every key may run; a collection-scoped key sees a filtered list) with the api-key header the tools send, through the guarded egress with the URL normalized as the tools build it. An answer without a collection list is not taken as proof. The tools receive the key and the verified URL, so a run reaches only that instance. qdrant keeps its inline URL and optional key, which a self-hosted instance without an API key still needs, and points at qdrant_v2. The successor test matrix counts a field repeated per operation (Qdrant's URL) once. * fix(credentials): honor an optional domain field in the token secret builder The optional flag was honored by the create contract and connect form for any field, but the secret builder only applied it to the workspace ID and still required any domain field. Derive both the same way, and store a domain only when it is required or supplied. No descriptor marks a domain optional today, so stored secrets are unchanged. * fix(amplitude): send both saved keys to User Profile over Basic auth Amplitude's User Profile API documents only Basic authentication with the project API key and secret key. A saved Amplitude credential now fills the API key too, and the tool sends Basic auth whenever an API key is present. Inline calls that pass only the secret key keep the Api-Key header they sent before. * test(kalshi): keep only the signer cases that guard the key-type fix Drop the PKCS#1, query-string, literal newline and auth-header cases, which restate unchanged behavior or repeat the validator's Ed25519 check. * docs(amplitude): note that User Profile sends both saved keys in the v2 block TSDoc * fix(railway): require the workspace ID in the connect form once the token type is workspace * chore(audits): re-record the tool-registry boundary baseline for the new credential validators * fix(amplitude): default the saved credential's data residency to us |
||
|
|
d5e98fac3c |
feat(credentials): regional and instance hosts for saved LaunchDarkly, LangSmith, New Relic, Square, SendGrid, Hex, and Sentry credentials (#9926)
* feat(credentials): add defaulted region fields to token credentials and LaunchDarkly EU and federal instances A token credential's connection field can now declare a fixed option set (rendered as a dropdown) and a default value. The default is what a create that omits the field gets, and what a credential saved before the field existed resolves to, so existing credentials and API callers keep the host they always used. A reconnect that leaves the field blank keeps the stored value instead of falling back to the default. LaunchDarkly is the first provider to use it: the access token is checked at, and every LaunchDarkly tool sends it to, the commercial, EU (app.eu.launchdarkly.com), or federal (app.launchdarkly.us) instance it was created in. Runs without a saved credential keep the commercial host. * feat(langsmith): verify and run saved LangSmith keys in their region A LangSmith API key only authenticates in the region its organization lives in. The saved credential now carries that region (GCP US by default, or GCP EU, GCP APAC, AWS US, or Azure US), and the key check and every LangSmith tool use its documented API host. Credentials saved before, and runs without a saved credential, stay on api.smith.langchain.com. * feat(new-relic): add the JP data center to saved keys, tools, and the legacy block New Relic now documents a Japan region whose NerdGraph endpoint is api.jp.newrelic.com. Saved User API keys can be verified and run there, the tools route jp to it, and the legacy block's region dropdown offers it. The saved key's region field is now a dropdown. Unknown region values still fall back to the US endpoint, as workflows saved before regions expect. * feat(square): verify and run saved Square tokens in the sandbox Square credentials and resources of one environment cannot be used in the other. The saved credential now carries its environment (production by default, or sandbox), and the token check, every Square tool, and the catalog image upload operation call connect.squareup.com or connect.squareupsandbox.com accordingly. Credentials saved before, and runs without a saved credential, stay on production. * feat(sendgrid): verify and run saved keys of EU regional subusers on the EU host SendGrid serves regional subusers in the EU from api.eu.sendgrid.com. The saved credential now carries its region (global by default, or eu), and the key check, every SendGrid tool, and the mail send operation use that host. Credentials saved before, and runs without a saved credential, stay on api.sendgrid.com. The connect modal notes that Marketing Campaigns actions are not available to EU subusers. * feat(hex): verify and run saved Hex tokens on the workspace's hex.tech host Hex serves EU multi-tenant, HIPAA multi-tenant, and single-tenant workspaces from their own hex.tech host instead of app.hex.tech. The saved credential now carries that host (app.hex.tech by default), accepting only a single label under hex.tech so a token is only ever sent to Hex, and the token check and every Hex tool use it. Credentials saved before, and runs without a saved credential, stay on app.hex.tech. * test(credentials): type the regional host tests and keep region option types module-private * feat(sentry): verify and run saved Sentry tokens in their data storage region Sentry serves organizations whose data is stored in the EU from de.sentry.io, and its organization list is per region. The saved credential now carries its region (us by default, or de), and the token check and every Sentry tool call sentry.io or de.sentry.io accordingly. Credentials saved before, and runs without a saved credential, stay on sentry.io. * feat(credentials): report a defaulted region field's default in the provider catalog The v2 provider catalog marked a defaulted region, instance, or host field optional without saying what it defaults to. Each field now carries an additive optional defaultValue, and the OpenAPI document and CLI client are regenerated. * docs(square): say a saved credential can hold a sandbox access token * fix(credentials): keep default-region token credentials as they were and share region definitions - A credential on its provider's default region or host keeps the bare service display name, and a vendor region host that fails to resolve is reported as the vendor being unavailable, not a typed host that was not found. - defaultValue is honored on the domain field only; providerWorkspaceId keeps its required, non-defaulted handling everywhere, so a blank reconnect can never reset it. - One defineCredentialRegions factory now holds each vendor's region ids, hosts, labels, default, API base, and hidden tool param (LaunchDarkly, LangSmith, New Relic, SendGrid, Sentry, Square); the internal SendGrid and Square schemas validate against it, and the New Relic descriptor and block take their options from it. - One isTokenServiceAccountFieldRequired predicate replaces the inline defaulted-is-optional checks. - Hex refuses its known non-workspace hex.tech labels (status, learn, docs, www, help, community, blog), and the pattern's comment no longer claims more than it guarantees. - Drops a mock-only and two pass-through tests; adds Sentry to the default-region tables. * test(credentials): guard a named reconnect region against the stored one Fold the named-region reconnect case into the blank-reconnect table as a contrast row on a credential stored in eu, so it fails if a reconnect always keeps the stored region. * test(credentials): drop the repeated mock reset in the legacy region tests |
||
|
|
f947d95a8f |
feat(credentials): audit fixes and non-OAuth auth for CrowdStrike, Datadog, Gong, PlanetScale, SailPoint, ServiceNow, Zendesk, ZoomInfo, Shopify, Atlassian, Linear and Twilio (#9911)
* fix(credentials): accept permission-scoped AgentMail keys at connect
A valid AgentMail key that lacks inbox_read or is scoped to a pod or inbox
gets a 403 coded missing_permission or forbidden on the inbox listing, and
was refused as invalid. Accept a coded 403 as proof of the key, and keep
rejecting the gateway's bare Forbidden and the key-naming 401 codes.
* fix(credentials): offer Atlassian API tokens for the Bitbucket saved credential
Bitbucket takes an Atlassian API token created for Bitbucket as a Bearer
token, so the existing repository read already verifies one. Say so in the
connect copy and setup guide, and note that app passwords no longer work.
* fix(credentials): ask for a reconnect when a Microsoft app certificate can no longer sign
An expired or unreadable stored certificate failed before any request reached
Entra, carried no status, and was reported at run time as the provider being
temporarily unavailable (502). Local configuration failures now classify as
invalid_credentials, and only an unreachable Entra keeps provider_unavailable.
Saving also refuses a certificate that is not valid yet.
* fix(credentials): warn that saved Infisical access tokens expire
Sim stores the machine identity access token as pasted and never renews
it, so it stops at its Access Token TTL (30 days by default). Tell users
to set a long TTL and Max TTL, and not an Access Token Period, which needs
renewal each period.
* fix(credentials): retry keyless Microsoft token requests while a federated credential propagates
Entra can refuse a new federated identity credential with AADSTS70021 for
several minutes after it is added, even after a token was issued, and
Microsoft asks callers to retry. A run now retries that refusal (and
AADSTS700213) twice with jittered backoff before reporting it; the save-time
subject-pin probe, which expects the refusal, is unchanged.
* fix(infisical): keep the instance URL out of the model's reach and normalize it like a saved credential
The legacy Infisical tools let the model set baseUrl, so a prompt-injected
agent call could send the inline Infisical token to any public host. baseUrl
is now user-only (matching Grafana and Upstash), and inline instance URLs go
through the same normalizer the saved-credential validator stores, which moves
from the validator module into input-validation so tools can share it.
* feat(credentials): accept HubSpot service keys for the saved HubSpot credential
HubSpot stopped new legacy private apps on October 26, 2026 and points
direct integrations at service keys, which are Bearer tokens for the same
REST APIs. The connect copy now asks for a service key or an existing
private app token. The token-info route covers only private apps, so a
non-transient refusal there defers to the Account Information API, and that
fallback accepts a 403 only with a JSON body, so a firewall page never
passes as a live token. Both checks refuse redirects.
* feat(credentials): accept Microsoft app credentials for Intune
Every Intune operation the block offers (managed devices, detected apps,
compliance policies and their device statuses, device configurations, and the
sync, restart, remote lock, and retire actions) documents application
permissions in Microsoft Graph v1.0, so the Intune picker now lists Microsoft
app credentials and the resolver mints a Graph token for them. OAuth Intune
connections are unchanged. The setup docs name the application permissions
each operation needs.
* fix(credentials): refuse rotating Slack tokens for custom bot credentials
A Slack app with token rotation on issues xoxe.-prefixed tokens that expire
in 12 hours and can only be refreshed with the app's client ID and secret,
which Sim never holds. Such a token passed auth.test at connect and failed
every run after. Refuse xoxe tokens up front with a message that asks for
the xoxb- token of an app with rotation off.
* docs(credentials): correct the Devin key check comment to match Devin's docs
Devin documents 401 for an invalid key and one 403 for both a key outside
the organization and a key without ViewOrgSessions. Behavior is unchanged:
nothing documented separates the two 403s, so a 403 still rejects.
* fix(credentials): refuse redirects in every per-vendor saved-key check
The shared token-check engine already refuses redirects, but the per-vendor
validators followed them. Fetch keeps custom headers such as x-api-key and
X-Shopify-Access-Token on a cross-origin redirect, so a redirected check
would hand the key to another host. Every per-vendor check now refuses a
redirect, which surfaces as the provider being unavailable.
* fix(credentials): treat a Webflow token that reaches no site as the user's error
GET /v2/sites lists every site the token can access, so an empty list is a
token the user must replace, not a retryable outage. A token that reaches
several sites is no longer pinned to whichever site the list returns first.
* feat(credentials): pick and connect Google service accounts for Vertex AI
The Vertex AI runtime already resolves Google service account credentials,
keyless or JSON key, but the Google Cloud Account picker on model blocks only
listed OAuth accounts, so a saved service account could be used only by
pasting its ID in advanced mode. Vertex AI now names google-service-account
as its service-account provider, and its picker lists both kinds with a
connect action for each, so the keyless option is offered for Vertex.
Existing OAuth selections and the advanced credential ID field are unchanged.
* fix(copilot): let Copilot pass a saved credential to hybrid tools
Copilot's integration schema only offered credentialId for tools that require
OAuth, so a tool that takes an inline key or an optional saved credential always
demanded the inline secret and the gateway never forwarded a saved credential.
On the copilot surface those tools now declare an optional credentialId and stop
requiring the params a saved credential supplies; the workflow surface and
OAuth-required tools are unchanged. The executor now rejects a Copilot call to
such a tool that sends neither, instead of calling the provider without a key.
* fix(credentials): report a NerdGraph error answer as New Relic being unavailable
New Relic refuses an unknown or wrong-region User key with a 401, so a 200
whose errors array left the fixed actor query unanswered is NerdGraph
failing, not a verdict on the key. Report it as provider_unavailable
instead of telling the user their key is wrong. A 200 with no user and no
errors still rejects.
* fix(aws): refuse S3 presigned URLs that outlive the saved role session signing them
A presigned URL signed with STS credentials stops working when the role session
ends, whatever expiry it asks for, but the S3 tool reported the requested expiry.
Resolved sessions now carry the STS expiration, and presigning with a saved
assume_role or oidc_role credential refuses an expiry past the session's end
with a 400 that names the remaining time and the session duration. Long-lived
access keys and inline keys are unchanged.
* fix(guardrails): resolve the hallucination check's Vertex credential like every other model call
The hallucination check looked the Vertex credential up as a raw account ID,
so a saved credential (whose ID is a credential row, OAuth or Google service
account) resolved no token and the scoring call ran without one. It now uses
the shared Vertex resolver, which handles credential rows, Google service
accounts, and the legacy account IDs the old lookup accepted, and fails the
check instead of calling the model when the credential cannot be resolved.
* fix(aws): report transient STS failures on a saved credential as 503, not a denial
Every failure to resolve a saved AWS credential came back as a 403, so an STS
outage, throttling, or STS failing to reach Sim's OIDC issuer (IDPCommunicationError)
read as a permission problem and was never retried. Failures STS models as
retryable, throttling, STS 5xx, and network errors now return 503; real denials
(AccessDenied, invalid or expired identity tokens, rejected claims) stay 403.
No extra retry loop is added: the pinned STS client already retries
IDPCommunicationError and throttling up to three times with backoff.
* fix(databricks): report an unreachable workspace at token mint as provider_unavailable
A connection failure, timeout, or refused redirect while minting a run's
Databricks token escaped as a raw fetch error, which the executor reported as a
generic 401 and whose cause can carry connection details. It is now a 502
DatabricksCredentialError, which resolves to provider_unavailable; a cancelled
run still rethrows its abort, and personal access tokens are unaffected.
* feat(credentials): connect Shopify Dev Dashboard apps with client credentials
Shopify Dev Dashboard apps never reveal an Admin API token, so the Shopify
saved credential gains a client-credentials mode beside the pasted shpat_
token. A credential saved with authMethod client_credentials stores the
client ID, secret, and store domain; execution mints the 24-hour token at
the store's /admin/oauth/access_token endpoint.
Shopify does not document whether a new token retires earlier ones, so
every saved credential for one app and store shares a single token kept
under an advisory lock in client_credential_token, instead of minting per
worker. shop_not_permitted surfaces as grant_not_permitted with copy that
names the same-organization requirement.
Pasted-token credentials, their blob, and their resolution are unchanged;
the minted-token cache in the credential service is factored out so the
client-credential providers and this mode share it.
* fix(credentials): keep keyless off when a pinned workload identity issuer has an unserved path
Sim serves workload identity discovery and keys only under /oidc/workload, and
clouds fetch <issuer>/.well-known/openid-configuration, so a WORKLOAD_IDENTITY_ISSUER
with any other path advertised keyless credentials that no cloud could verify. A
pinned issuer must now have the /oidc/workload path (its host may differ), or
keyless stays off with a log line naming the requirement. The default issuer
derived from the app URL is unchanged, and the self-hosting and AWS credential
docs state the requirement.
* feat(credentials): saved CrowdStrike API client credential and credential-only block
A CrowdStrike credential holds a Falcon API client id and secret, the cloud
(from the existing Falcon cloud allowlist), and an optional MSSP member CID.
The minter posts them to the cloud's /oauth2/token with redirects refused and
returns the token with its expires_in lifetime (30 minutes when unusable)
and the cloud, which the credential cache keys by credential id and secret
fingerprint, so changing the cloud or secret re-mints.
- clientCredentialOAuth: a policy for tools that mint their own token from
inline client credentials. The credential fills the hidden accessToken and
the region param; tokenReplacesParams names the inline secrets the token
replaces, and the saved-credential contract check accepts exactly those.
- crowdstrike_v2 is the credential-only successor; the legacy block keeps
its inline client id, secret, and cloud and is hidden from the toolbar.
- The operation uses a credential's token as is. Inline credentials now
reuse a cached token (keyed by cloud, client id, and secret hash) until a
minute before it expires, and a 401 drops it so the next run re-mints.
- Client-credential mints can bind a domain (the cloud), carried through
the token cache to tools.
* fix(credentials): accept only documented scoped-key answers from AgentMail and New Relic
AgentMail now proves a key only on the two 403 codes its docs give for a
valid key with the wrong scope (missing_permission, forbidden); a suspended
account, a gateway deny, and any other refusal reject the key.
New Relic reports an outage only for NerdGraph errors in the server classes
its own client retries; BAD_API_KEY and unclassified errors reject the key.
* fix(credentials): settle HubSpot service keys on the account-info route
A token-info 200 without a portal now falls back to account-info instead of
failing as an outage, and a token-info 401 falls back only for pat- keys, so
other tokens keep being rejected there as before. The vendor-JSON 403 check
moves to one shared helper.
* docs(credentials): align HubSpot, Infisical, and Bitbucket saved-key copy with vendor docs
* feat(credentials): saved Zendesk credentials with client credentials or an API token
Zendesk gets a zendesk-service-account credential with two sign-ins: a
confidential OAuth client exchanged through the client-credentials grant
(POST /oauth/tokens, JSON, an explicit read or read write scope, a one-hour
expires_in), or an agent email and API token sent as the documented
email/token Basic credential. The subdomain is normalized and must match
^[a-z0-9][a-z0-9-]*$ before any request, and connecting requires
users/me to answer with a real (non-anonymous) agent or admin.
The credential resolves to its token, its subdomain as domain, and
authStyle basic for the API-token sign-in. zendesk_v2 is the
credential-only successor; every Zendesk tool reads the token through one
header helper and takes its subdomain from the credential. The legacy
zendesk block and its inline email, API token, and subdomain keep signing
in exactly as before.
* feat(credentials): PlanetScale saved service token credential
A PlanetScale credential holds a service token and its ID, verified by
listing the organizations the token reaches with the same ID:token
Authorization the tools send; a JSON 403 is a valid token without that
read. Every PlanetScale tool accepts it, the selectors gain saved-credential
twins that read the pair from the credential, and planetscale_v2 is the
credential-only successor. The legacy block keeps its inline inputs.
* feat(credentials): Gong saved access key credential
A Gong credential holds an access key and its secret, verified by listing
workspaces on api.gong.io with the Basic key:secret the tools send. Gong
documents its 403 for this read without telling a bad key from a missing
permission, so any refusal rejects. Every Gong tool accepts the credential
and gong_v2 is the credential-only successor; the legacy block keeps its
inline inputs.
* feat(credentials): ServiceNow saved username and password credential
A ServiceNow credential holds an instance, a username, and its password,
verified by reading one user id from the Table API with the Basic auth the
tools send. The instance is reduced to the https origin of a
ServiceNow-owned host before anything is sent, and the check goes through
the guarded egress; 401 rejects, a JSON 403 is a login its ACLs limit, and
only a Table API result list proves the login. Every ServiceNow tool
accepts the credential, servicenow_v3 is the credential-only successor, and
servicenow and servicenow_v2 keep their inline inputs as legacy blocks.
* feat(credentials): Twilio API key mode for the saved Twilio credential
The Twilio credential and every Twilio tool now also take an API key, as
the key SID and secret joined by a colon (SKxxx:secret), the exact Basic
username and password Twilio documents for a key, while the URL keeps the
Account SID. A key is verified by listing one of the account's phone
numbers, a read a Standard key may make, since only Main keys and auth
tokens may read the Accounts resource. Stored auth-token credentials and
inline auth tokens keep their shape and their account-resource check; a
value with a colon that is not a key pair is refused before any request.
* fix(credentials): retry only the documented Entra propagation refusal, within the shared mint deadline
AADSTS700213 is Microsoft's documented case-sensitive federated credential
mismatch, not a propagation refusal, so a mismatched keyless credential no
longer makes three token requests per run. The AADSTS70021 retries now stop
when a slow answer would push the run past the 30 s deadline that concurrent
runs sharing the mint wait for. The Microsoft app service list is declared
once for both its type and the resolver's check, and the Intune and Vertex
copy names the app credential and the Google service account.
* feat(credentials): Atlassian service-account OAuth 2.0 credentials
An Atlassian service account can now connect with its OAuth 2.0
credential (client ID and secret) as well as a scoped API token. Saved
with authMethod client_credentials, the credential stores the client
credentials, the site, its cloudId from tenant_info, and the product;
execution mints a 60-minute token at auth.atlassian.com with the client
credentials grant and calls api.atlassian.com/ex/{product}/{cloudId}
exactly as a scoped token does. Connecting proves the minted token
against the product's current-user endpoint.
Atlassian documents these credentials for Jira and Confluence only, so
other products are refused. It does not say whether a new token retires
earlier ones, so every saved credential for one OAuth client shares one
coordinated token. Scoped-token credentials, their blob, and their
resolution are unchanged; the identity request now refuses redirects.
* feat(credentials): saved Datadog API and application key credential and credential-only block
A Datadog credential holds the site (from the DATADOG_SITES allowlist), the
API key, and the application key. Datadog authenticates every request with
the two static headers, so the "mint" resolves the API key as the token, the
application key beside it, and the site as the credential's domain.
- Save verifies the API key with GET https://api.{site}/api/v1/validate,
sending DD-API-KEY alone, redirects refused: 403 is invalid_credentials,
and a 200 must report valid: true. The application key is not probed:
Datadog publishes no reference for an application-key check, and any other
read would reject a correctly scoped key with a permission 403. Keys with
control characters or whitespace are refused before any request.
- Credential resolution carries a new applicationKey field (credential
cache, token payload contract, executor credentialParams source), and the
Assistant registers it as a resolved secret beside the token.
- Every Datadog tool takes the saved credential: the credential fills apiKey,
applicationKey (where the tool sends it), and site, overriding caller values.
- datadog_v2 is the credential-only successor; the legacy block keeps its
inline keys and site and is hidden from the toolbar. withSavedCredential
accepts condition: null for a picker shown in every operation when the
replaced fields show differently.
* fix(aws): bound S3 presigned URLs by the role session's duration, not its time left
The presign guard compared the requested expiry with the seconds left before the
STS session ended, floored. A session is minted for each call, so by the time the
guard runs the STS round trip has used part of it and a default 3600s session
reports 3599s left, which refused the default 3600s expiry for every saved
assume_role or oidc_role credential on default settings.
Resolved sessions now carry the duration Sim requested from STS, and the guard
refuses only an expiry longer than that duration. The reported expiresAt is
clamped to the session's end, so it is never later than the time the URL stops
working. The session lookup that the signer and the guard share is one helper.
* fix(aws): classify wrapped STS socket failures as transient with the shared network-error helper
isTransientAwsFailure kept its own list of socket codes and checked only the top-level code, so a socket failure the SDK request handler wrapped in a cause, or an undici code, was reported as a 403 denial instead of a 503. It now uses isRetryableNetworkError, which walks the cause chain and errno.
* feat(credentials): connect Linear OAuth apps with client credentials
The Linear saved credential gains a client-credentials mode beside the
personal API key. Saved with authMethod client_credentials, it stores the
app's client ID and secret and mints an app-actor token at
api.linear.app/oauth/token with the fixed scope read,write, so two
credentials for one app never request different scopes (which Linear
treats as replacing the app's tokens). Linear documents that tokens with
the same scopes coexist, so each worker caches its own, and a token is
reused for at most an hour so one revoked early is replaced quickly.
A client-credentials token acts as the app, so connecting falls back to
the workspace (organization.id) as the principal when Linear returns no
viewer. The connect copy warns that requesting a token replaces an
existing authorization-code installation of the app and that rotating
the secret invalidates its tokens. Personal API keys and Linear OAuth
credentials are unchanged.
* fix(credentials): warn instead of turning keyless off for a pinned issuer on another path
Refusing a pinned WORKLOAD_IDENTITY_ISSUER whose path was not exactly
/oidc/workload turned keyless off on upgrade for a deployment that routes a
different issuer path to Sim through a proxy, and it also refused pinning the
default issuer of a path-prefixed app URL, which the default itself accepts.
Trust policies name the issuer, so those operators could only recover by
recreating the identity provider and every trust policy.
A pinned issuer whose path ends in /oidc/workload is now accepted the same way
the default is. Any other path logs a warning that clouds can verify its tokens
only if a proxy routes it to /oidc/workload; saving a keyless credential still
proves the route end to end. The https, port, query, and fragment refusals are
unchanged, and the docs describe the rule.
* fix(copilot): exempt a hybrid tool's key only when the hosted key applies to the call
The Copilot credential check waived a hybrid tool's hosted key param whenever the deployment was hosted, but injectHostedKeyIfNeeded skips the hosted key when the tool's hosting.enabled predicate rejects the params, so such a call could reach the provider with neither a key nor a saved credential. Both now use one hostedKeyMayFill predicate. No hybrid tool declares hosting today, so this is latent.
* fix(databricks): stop repeating 'Try again' when the save-time probe cannot reach the workspace
The unreachable-workspace error ended in 'Try again.', and the federation-policy check that wraps it adds its own, so a save showed 'Try again. Try again.'. The low-level message now only names the failure.
* fix(credentials): refuse redirects by default in fetchProvider
Every fetchProvider caller sends a secret, and fetch replays custom headers
and 307/308 bodies to whatever host a redirect names. Default the helper to
redirect: 'error' so validators and client-credential mints inherit it, and
drop the per-call copies this branch had added.
* fix(credentials): settle a HubSpot key account-info refuses with a contacts read
HubSpot documents service keys only against its CRM REST routes, not the
token-info or account-info routes. When account-info answers 401, confirm
on a one-contact read, where a 200 or JSON 403 proves the key is live and a
401 rejects it.
* test(security): move the typed base URL normalizer test next to input-validation
normalizeHttpBaseUrl and refuseUnsafeTypedUrl moved from the token validator module into input-validation; their test now lives with them.
* feat(credentials): saved SailPoint API client credential and credential-only block
A SailPoint credential holds a tenant plus an API client or personal access
token client id and secret. The minter shares the legacy block's token
exchange (now requestSailPointToken in lib/internal/sailpoint/client: the
client_credentials grant at the tenant's /oauth/token, redirects refused,
bounded 429 retries, and a SailPointAuthError carrying the status), so 4xx
maps to invalid_credentials and 5xx, throttling, or network failures to
provider_unavailable. The token lifetime comes from expires_in.
- The tenant is normalized to {tenant}.api.identitynow.com, the host
SailPoint documents for API and token calls, from a tenant name, the API
host, or the tenant's UI URL. Anything else (other domains, credentials,
ports, more than one tenant label) is refused before the secret is sent.
The legacy block's inline tenants, including identitynowgov.com hosts,
are unchanged.
- The credential fills the hidden accessToken and the tenant (its API host);
the operation sends that token as is and never re-mints it on a 401.
Inline credentials keep their cached token and single 401 refresh.
- sailpoint_v2 is the credential-only successor; the legacy block keeps its
inline tenant, client id, and secret and is hidden from the toolbar.
* feat(credentials): saved ZoomInfo client credentials and credential-only block
A ZoomInfo credential holds a client credentials app's client id and secret.
The tools already authenticate with that grant (Basic auth at
api.zoominfo.com/gtm/oauth/v1/token), so the minter shares the legacy
block's exchange, now requestZoomInfoToken: a refusal throws
ZoomInfoTokenError, which the operation answers exactly as before (HTTP 500
naming the provider status) and the minter maps to invalid_credentials for a
4xx or provider_unavailable for throttling, 5xx, or network failures.
- Save verifies by minting a token only; the token endpoint uses no credits
and no data endpoint is called. Granted scopes are recorded as metadata.
- A client id with a colon or control characters is refused before any
request, since it would corrupt the Basic credential.
- The token exchange and API calls refuse redirects (maxRedirects: 0); both
go only to the fixed api.zoominfo.com host.
- The credential fills the tools' hidden accessToken, which replaces the
inline client id and secret; zoominfo_v2 is the credential-only successor,
and the legacy block keeps its inline credentials and is hidden from the
toolbar. Search filters named like hosts are recorded as request data in
the saved-credential contract check.
* refactor(gong): share one Basic auth header builder between the tools and the credential check
* fix(credentials): stop accepting an undocumented PlanetScale 403 as proof of a service token
PlanetScale documents 401 for a bad token and 404 for missing access, but gives no meaning to a 403 from listing organizations, so a JSON 403 now rejects like any other refusal. The token ID is checked in the account-id normalizer with the same printable, colon-free rule the tools' header builder applies.
* test(credentials): prove refused saved-credential hosts never reach the guarded egress fetch
The steer cases asserted only on the global fetch stub, but ServiceNow sends through the guarded egress transport, so its 'before sending the key' half never ran. Both transports now answer, so only the refusal can keep the key unsent.
* fix(credentials): tell ServiceNow and Gong users which hosts the saved credential supports
ServiceNow custom URLs are aliases of the instance's original service-now.com address, so the help text points custom-URL tenants there; on-premises instances are named as unsupported. Gong's help text names the fixed api.gong.io host the tools call.
* docs(credentials): document the in-band Twilio API key form and hint a half-entered key pair
The saved Twilio credential keeps an API key in the auth-token field as SKxxx:secret, Twilio's documented Basic username and password for a key. The provider id now records that choice and warns that a consumer needing the account auth token itself, such as webhook signature validation, must refuse a key pair. The connect form shows a hint while an SK value is not a complete SID:secret pair.
* fix(credentials): share the CrowdStrike token exchange and report a wrong Falcon cloud
- Legacy inline tokens are also dropped on a 403, so a scope granted after a
failed run applies on the next one, as it did before tokens were cached.
- The saved-credential minter and the legacy path call one exchange,
requestCrowdStrikeToken; the legacy path keeps following redirects.
- The minter never follows a redirect and reports one as invalid_credentials
naming the API client's cloud from X-Cs-Region, instead of a provider outage.
- Drop the unused instanceUrl param and cap a saved-credential accessToken.
* fix(credentials): expire shared client-credentials tokens the provider rejects
A token served from the shared client_credential_token row was never expired
early, so a Shopify or Atlassian token revoked before its stated expiry kept
being served, and reconnecting with the same secret got the same dead token.
- invalidateCoordinatedClientToken expires exactly the rejected token
- saving or reconnecting re-mints once when the provider rejects the served token
- a 401 from a tool call on a service-account credential expires the token
- expired failure memos are swept by the shared coordinator, which Vanta now reuses
- drop the Atlassian product check that could never refuse anything
* fix(credentials): report a mistyped SailPoint tenant as not found and share site lists
- A SailPoint tenant host that does not resolve (ENOTFOUND) is site_not_found,
not a provider outage; a transient resolver failure stays provider_unavailable.
- The tenant normalizer refuses `api`, SailPoint's own API domain, in every
input form instead of minting at api.api.identitynow.com.
- Datadog site labels and the isDatadogSite guard live once in tools/datadog and
serve the block, the connect modal, and the minter; CrowdStrike cloud labels
derive from the cloud ids.
* fix(credentials): drop the unverified ZoomInfo token-credits claim and cap saved tokens
ZoomInfo's client-credentials docs do not say whether a token request uses
credits, so the docs and comments describe only what Sim does: connecting
requests a token and calls no data endpoint. A saved-credential accessToken is
capped at 16 KiB like SailPoint's.
* fix(credentials): share one Linear client-credentials token per app
Linear asks clients to reuse a token until shortly before it expires and to
request a new one after a 401, and caps an app at 1,000 tokens per workspace
through cleanup. Each worker minted a new 30-day token every hour instead.
Linear now goes through the coordinated token for its full lifetime, and the
401 path replaces it early; every token grant now coordinates, so the grant
registry maps providers straight to minters.
* fix(credentials): keep a credential's client-credentials mode on reconnect
A reconnect that sent only a new client secret for a Shopify, Linear, or
Atlassian client-credentials credential was routed to the pasted-token
builder and failed. The stored mode now carries forward unless the reconnect
sends a token. The connect modals no longer preselect a mode on reconnect, so
the admin restates it instead of silently switching modes.
* docs(credentials): align Zendesk, Linear, and Shopify copy with vendor docs
- mark Zendesk API tokens as deprecated by Zendesk in the picker, hint, and docs
- warn that a Linear client-credentials request with other scopes revokes tokens
- say where Shopify's 24-hour token is kept instead of claiming it is never stored
- reword comments that stated undocumented Linear and Zendesk behavior as fact
* fix(credentials): drop exports that only their own module uses
* fix(credentials): keep shared tokens on scope 401s and rate-limit tool-call expiry
A 401 whose body reports a scope mismatch (Atlassian's 'Unauthorized; scope
does not match', RFC 6750 insufficient_scope) comes with a valid token, so it
no longer expires the application's shared token. A tool-call rejection also
leaves a token minted within the last minute in service, so a call that keeps
failing re-mints at most once a minute. Connect-time identity proofs still
expire a rejected token unconditionally.
* fix(credentials): replace the shared Linear client-credentials token daily
Linear tokens live 30 days, but a revocation that does not surface as a 401
would otherwise keep a dead token in service until then. Same-scope tokens
coexist, so a daily replacement leaves in-flight calls valid.
* chore(credentials): regenerate block successors, tool metadata, deployment config, integration docs, OpenAPI and CLI API for credential auth wave 2
* test(credentials): drive the slow Entra answer from the propagation suite's fake clock
* fix(credentials): declare the Zendesk email and API token as replaced by the saved credential's token
* test(credentials): wait for the slow Entra answer with the shared sleep helper
* fix(crowdstrike): mint a new token for each legacy inline request again
The inline token cache held a Falcon token for up to 29 minutes, so a token
Falcon had since revoked or rescoped failed the next run. Legacy blocks mint
per request as they did before the saved credential.
* fix(credentials): drop a saved client-credential token a provider refuses
Internal operations such as CrowdStrike and SailPoint answer 401 or 403
when the provider refuses a saved credential's token. The executor now
drops that token from the per-instance cache so the next call mints a
replacement instead of reusing it until it nears expiry.
* test(credentials): serve the stored coordinated token until it is invalidated
The coordinated-token mock minted on every call, so the revoked Atlassian
token test passed with the invalidation removed. The mock now keeps one
token per application until invalidated.
* refactor(credentials): share one client-credentials token exchange
Atlassian, Linear, and Shopify each carried the same form POST, refusal
mapping, payload check, and lifetime cap. They now call one
exchangeClientCredentialsGrant, tested once, and keep only their URL,
extra fields, lifetime cap, and Shopify's refusal classifier.
* fix(credentials): read and decrypt a client-credentials secret once per resolution
Token providers and Atlassian read and decrypted the stored secret to pick
its mode, then read and decrypted it again to mint. The mode read now
carries into the mint, and both blob parsers share one mode check.
* refactor(credentials): share the credential-text check across minters
Fivetran, ZoomInfo, and Datadog each carried the same empty, control
character, and size check. They now call one assertCredentialText, with
Datadog also refusing spaces.
* refactor(zendesk): encode the API-token Basic credential in one place
The saved-credential minter and the tools each built the
{email}/token:{apiToken} Basic value. Both now call
zendeskApiTokenCredential, so the saved and inline sign-ins cannot differ.
* refactor(tools): declare the saved-credential token param once
CrowdStrike, ZoomInfo, and SailPoint tools each repeated the hidden
accessToken param a saved credential fills. They now use
savedCredentialTokenParam, with the same descriptions.
* fix(tools): name a missing credential field without naming Datadog
The generic credential-field labels named Datadog for applicationKey, so
any other tool mapping it would blame a Datadog key. Labels now carry
their article and stay provider-neutral.
* fix(security): redact Datadog application keys in logged inputs
No key-name pattern matched applicationKey, so a key typed into the
legacy Datadog block showed in plaintext in execution input logs.
* fix(credentials): match the Atlassian OAuth 2.0 hints to what Atlassian supports
In client-credentials mode the Jira client ID hint said one credential
covers Jira Service Management, which Atlassian does not list for OAuth
2.0 credentials. It now points Service Management at a scoped API token.
Also corrects the reconnect note on clientCredentials.preferred.
* refactor(credentials): share the client ID and secret fields across connect forms
The Atlassian and token-provider forms each built the client-credentials
fields, and only one labelled its secret input for assistive tech. Both
now render ClientCredentialsFields.
* docs(credentials): describe the saved credentials on their setup-guide pages
The PlanetScale, ServiceNow, Gong, and Twilio pages are the connect
modal's setup guides but still described only the legacy inline inputs.
Each now says how to add the credential, the hosts it accepts, and that
earlier blocks keep their inline values. SailPoint v2 names both the PAT
and the client-credentials API client.
* test(credentials): mock credential-service through the central @sim/testing mock
* fix(sailpoint): accept government tenant hosts on the saved credential, as the earlier block does
* fix(servicenow): accept custom and self-hosted https instance URLs on the saved credential, as the earlier block does
* fix(credentials): type the new test fixtures, unexport file-local types, and regenerate CLI docs
* fix(credentials): drop refused local tokens, keep exact ServiceNow passwords, and refuse non-http URL forms
- Forget a client-credential token cached on this instance when an external
request answers 401, alongside expiring the coordinated token.
- Add preserveWhitespace to token descriptor fields; ServiceNow passwords keep
their surrounding spaces through the connect form, contracts, and builder.
Contracts no longer trim apiToken; Atlassian and GitLab builders trim it.
- Refuse any scheme other than http(s), and protocol-relative or backslash
authorities, in the shared typed-URL helpers while bare host:port still works.
- Refuse client-credentials extra fields that would replace grant_type,
client_id, or client_secret.
- Report a Datadog validate answer without a boolean valid field as a provider
fault rather than invalid credentials.
* fix(credentials): report an aborted grant refusal as the abort, and keep the CrowdStrike cloud required
* fix(credentials): name a dropped connection separately from a malformed token response
|
||
|
|
5bbf4e748b |
feat(api): failing block on polled runs, deployed input schema, paused-runs list, and applied limits (#9906)
* feat(api): attribute polled run failures, deployed input schema, paused-run list, and applied run limits
- GET /v2/workflows/{id}/runs/{runId} reads the failing block back from the run's
recorded trace, withheld when the viewer's permission group hides execution data
- GET /v2/workflows/{id} adds inputSchema for the active deployment's API run input
- GET /v2/workflows/runs/paused lists a workspace's runs waiting on human input,
projecting pause points exactly as the run detail does
- Execute responses report executionTimeoutSeconds; GET /v2/billing/status adds plan limits
* fix(api): respect the paused-run page cap in the CLI and keep waiting pause points under the cap
- CLI generator carries a numeric field's contract maximum; the pager never requests
a page above it while still paging to the caller's total --limit
- Pause point cap keeps points not yet resumed before resumed history, so a run that
paused again is never listed without its waiting point (run detail and paused list)
* improvement(api): reuse FailedTraceBlock and sort pause points once when capping
* fix(api): custom-block trace boundary, legacy pause point arrays, and list point selection
- A custom block is an opaque trace boundary for failing-block attribution
- The paused-run list reads object and legacy array pause_points
- The list selects waiting human points before the per-run cap, reads points in
waves that stop once the page budget is spent, and shares one waiting predicate
- Resume response schemas omit executionTimeoutSeconds
- Drop a non-null assertion from the CLI page cap test
* fix(api): attribute concurrent failures to the stored error's block and never fail a workflow read on its deployment
- Failing-block attribution prefers the span the stored error names, else the
failure that ended first, else none; the block error prefix has one owner
- The workflow read degrades inputSchema to null when the deployment cannot be
read or its schema has an unexpected shape
- Integration cases for time-only, archived, and cross-workspace exclusion
* fix(api): consistent trace walk, block-named error attribution, required applied timeout, and ungated input schema
- Failing-block attribution walks spans as hasUnhandledError does, through
successful blocks, with one shared successful-boundary rule
- An error message headed by the failing block's name is attributed to it even
when the name reads as a run-level failure
- executionTimeoutSeconds is required (nullable) on Execute workflow responses
- The workflow read takes inputSchema from the active version row, not isDeployed
- Pause cap wording: unresolved points are kept in preference, listed earliest first
- Regenerate the CLI API the previous contract wording left stale
* fix(api): parse resume responses with the resume schema in e2e scripts and regenerate the CLI API on staging
- Stop-after and pinned-execute e2e scripts parse resume responses with
v2ResumeWorkflowDataSchema, which omits executionTimeoutSeconds
- Regenerate the CLI API against the merged staging contracts
* fix(api): parse the stop-after e2e resume helper's response with the resume schema
|
||
|
|
3d8996f0e6 |
feat(api): workflow outline, workspace schedules list, clearer v2 errors, and catalog value types (#9905)
* feat(api): add traceId and field paths to v2 errors, name the read-only key remedy * feat(api): publish declared value types on block catalog fields * feat(api): add workflow outline and workspace schedules reads to v2 * fix(api): type declared catalog inputs as block params and regenerate the docs manifest * fix(api): compare member responses without their per-request traceId * improvement(api): tidy catalog field projection default and integration test comment * docs(api): say the outline's derived fields come from values state already returns |
||
|
|
ba66dfd6b7 |
feat(api): agent identity on v2 meta, scoped CLI pairing keys, and v2 workspace rename (#9904)
* feat(api): agent identity on v2 meta, scoped CLI pairing keys, and v2 workspace rename
- GET /api/v2/meta adds keyId, userId, workspaceId and links {openapi, docs, mcp};
existing fields unchanged. The API catalog shares the same link source.
- CLI pairing login accepts --read-only and --expires-in <days>. The request rides
the approval URL, is shown on the approval card, is recorded with the approval
and applied at mint; the unauthenticated poll cannot set either. The poll echoes
access and expiresAt, and the CLI refuses to store a key that does not match
what was asked (an older server mints full access). The signed-out login bounce
now keeps scope, workspace, access and expiry instead of dropping them.
sim whoami shows the key's expiry and bound workspace.
- POST /api/v2/credentials/connections returns draftId. Opening a connection link
that is unknown, expired or another account's now explains to sign in as the
creating account, without saying which case applied.
- PATCH /api/v2/workspaces/{workspaceId} renames a workspace or changes its logo
through the existing workspaces.identity.update operation, widened to personal
API keys and OAuth tokens (api:write); Admin still required, workspace keys
still denied. Workspace update operations move into the operations registry.
- Regenerated OpenAPI, MCP catalog, CLI client and CLI docs.
* fix(cli-auth): pass route context in the new approve and poll tests
* test(mcp): expect the identity fields getMeta now returns
* fix(workspaces): count members before the rename so a failed count never hides a committed update
* improvement(cli-auth): reuse the api-key access schema and tidy handoff validation
* fix(api): publish the workspace PATCH body rules and check CLI-minted keys exactly
- PATCH /v2/workspaces/{id}: the body schema publishes minProperties 1, and
logoUrl is a pattern (root-relative path or https URL, protocol-relative
refused) instead of an unpublished refine.
- sim login refuses a minted key whose access or expiry differs from the
request in either direction, with the expiry checked against the requested
days within a clock tolerance.
- sim workspaces update --logo-url documents that clearing the logo goes
through the API or MCP.
|
||
|
|
c844be83ac |
docs(api): guide for building and running workflows with the API (#9901)
* docs(api): add a guide for building and running workflows with the API * docs(api): point the workflow guide at the Sim skills * docs(api): pass only the operations array to the CLI in the workflow guide * docs(api): keep polling while a run is redacting |
||
|
|
a716b1b3ef |
chore(deps): bump turbo to 2.11.10 (#9903)
* chore(deps): bump turbo to 2.11.10 * docs(ci): describe the Turborepo 2.11 task-level planner flag |
||
|
|
9ab4e6f470 |
feat(credentials): keyless Snowflake, Microsoft app-only and Google keyless, GitHub and Bitbucket tokens, DocuSign JWT (#9869)
* feat(credentials): keyless Snowflake connections through workload identity federation A Snowflake connection can now trust Sim's OIDC issuer instead of holding a programmatic access token. Sim signs a short-lived token (audience snowflakecomputing.com) for the credential's own random subject; the customer creates a SERVICE user with WORKLOAD_IDENTITY = (TYPE = OIDC ISSUER SUBJECT). - Save verifies by minting a token and running the identity statement at the pinned account host through the guarded egress path; Snowflake's refusals keep the shared codes (invalid_credentials, site_not_found, provider_unavailable). Subjects bind to their creator like AWS/Databricks. - Runtime: the resolver returns authStyle 'snowflake-workload-identity' for a keyless credential, and the tools and selectors send Bearer WIF.OIDC.<token> with the WORKLOAD_IDENTITY_FEDERATION token type. authStyle and domain are authoritative on every Snowflake tool, so a caller can no longer choose the token type or steer the account host of a saved credential. - PAT credentials resolve and verify exactly as before. - Connect dialog offers the keyless service user with the CREATE USER statement; it falls back to the token dialog where keyless is unavailable. - Docs: Snowflake connections page with keyless setup, troubleshooting, and the 60-minute Snowflake key cache on signing-key rotation. * fix(snowflake): run Cortex Analyst SQL with the resolved credential and reopen keyless reconnects as keyless Cortex Analyst's "run the SQL" went through a nested snowflake_execute_sql call carrying the already-resolved token and host. With authStyle and domain now authoritative, the executor cleared both before the nested call, so it failed for every credential (and a keyless token would have been sent as a PAT). The generated SQL now runs as one guarded statement request built from the parent call's credential-derived host, token, and token type, through the same requestTarget egress the tool transport uses, with redirects refused. The Snowflake connect dialog opened every reconnect on the programmatic access token. The workload-identity prepare call now takes the reconnected credential and reports whether it is keyless (only to an admin of that credential in the same workspace), and the dialog opens on that mode. Docs: the 60-minute wait applies before signing with a new key; removing the old key needs 10 minutes with keyless Snowflake connections. * fix(snowflake): cancel Cortex Analyst's generated SQL with the run The generated SQL used to run as a nested tool call, which inherited the run's abort signal; running it directly dropped that. postProcess now receives the executor's effective abort signal as an optional fourth argument (the same signal the tool's own request used), and Cortex Analyst forwards it to the DNS check, the guarded fetch, and the response read. Other tools' postProcess hooks are unchanged. * feat(credentials): saved GitHub personal access tokens and Bitbucket access tokens GitHub: a saved personal access token credential (fine-grained or classic), verified against api.github.com/user with the tools' own headers. GitHub's workflow block authenticates with an inline token rather than OAuth, so it follows the token-block pattern: github_v3 is the credential-only successor of github_v2, which stays exactly as it was, marked legacy and hidden from the toolbar. Every GitHub tool declares the optional saved-token policy; inline tokens keep working. The GitHub App installation credential (Search) is a separate service and is untouched: the Assistant still projects GitHub tools onto the person's connected GitHub account, and Search policy now follows the visible GitHub block (github_v3). Bitbucket: a workspace, project, or repository access token as a second option next to OAuth (the Linear pattern), verified by listing one repository of the typed workspace on api.bitbucket.org; the slug is validated so it cannot steer the path. List Workspaces needs a signed-in user, so it now refuses a saved access token before any request. Also: isHostNotFound no longer lets an outer error code mask ENOTFOUND on its cause. * fix(credentials): close wave 2a review findings on GitHub and Bitbucket tokens - The GitHub token service is `github-token`, so it no longer shares an id with the GitHub sign-in provider: parseProvider and getProviderIdFromServiceId answer for sign-in exactly as before, and a token-only service is never marked connected from a sign-in account whose id prefixes it. - Suggested connect rows offer each integration once and count it connected when any of its services' OAuth or service-account credentials is saved (GitHub's Search App and saved tokens share one integration). - Assistant GitHub calls bind through the connected-account policy the Assistant projects (the person's github-repositories OAuth account) in the token resolver too, on both the ordinary and managed paths; workflow runs and saved workspace tokens are unaffected. - Bitbucket verification reads one repository (`workspace/repository`), the request Atlassian documents for workspace, project, and repository access tokens alike; listing a workspace is not documented for repository tokens. - prepare-workload-identity test uses the central credentials-access mock. * feat(credentials): DocuSign JWT Grant credentials next to OAuth A saved DocuSign credential that authenticates with JWT Grant (an integration key, an impersonated user ID, the app's RSA private key, and an environment), offered as a second option beside the existing OAuth connection, which is unchanged. The minter signs an RS256 assertion (iss = integration key, sub = user, aud = the environment's authentication host without a scheme, scope "signature impersonation"), exchanges it at that host's /oauth/token, then reads /oauth/userinfo on the same host to bind the pinned account (or the user's default) and returns its eSignature REST base. Both hosts come only from the stored environment; a base_uri outside that environment's docusign.net shape is never trusted with the token. GUIDs and the key are checked before any request, and tokens are re-minted about 15 minutes before they expire, as DocuSign advises. DocuSign tools take the account base as an authoritative credential param, so a caller can never supply it, and DocuSignClient skips its deployment-host userinfo lookup when one is bound. OAuth tokens resolve exactly as before. Save-time failures map to consent_required (the connect modal shows the exact consent URL for the key and environment) and account_not_found (a pinned account the user does not belong to), alongside the shared invalid_credentials and provider_unavailable codes. * fix(credentials): close wave 2b review findings on DocuSign JWT Grant - The DocuSign knowledge connector now honours a JWT Grant credential's bound account. The resolved token's instanceUrl reaches the connector as credentialInstanceUrl in the sync context (seeded on every path through syncContextForToken). The connector re-validates it with the same parser as DocuSignClient, lists and fetches from that account in the credential's environment, links envelopes to that environment's web app, and validates without asking the deployment host. A seeded value of the wrong shape fails closed. OAuth syncs are unchanged. - RSA keys under 2048 bits are refused as invalid_credentials with copy that names the size, instead of jose's raw TypeError. - A short expires_in no longer makes every call re-mint: the cached lifetime floors at six minutes while staying a minute under the real expiry. - The connect modal shows the consent URL as a link with a copy button, and account_not_found says "pinned account" only when one was entered. * feat(credentials): Microsoft Entra app-only credentials for Entra ID, SharePoint, Dataverse, and Dynamics 365 A saved Microsoft app credential (OAuth 2.0 client credentials) as an additional option next to Microsoft OAuth, which is unchanged. One app registration serves the four services whose tools run without a signed-in user; Outlook, OneDrive, Excel, Word, Planner, and Teams never offer it and token resolution refuses it for them (provider mismatch). - Modes: client secret; certificate (PS256 client assertion with the certificate's x5t#S256 thumbprint, aud = the tenant token endpoint, 5-minute lifetime; key/certificate pairing, RSA size, and expiry checked before any request); keyless federated credential (a Sim workload-identity token for the credential's own subject, audience api://AzureADTokenExchange, subject bound to the saving user, refused if the app also accepts an unheld subject). - The token resource comes from the tool's service, passed from the server-validated tool policy: Graph for Entra ID and SharePoint, the stored environment for Dataverse and Dynamics 365. Any other service is refused. - The environment URL is stored on the credential (public-cloud Dynamics hosts, https root only). Dataverse tools take credentialType and instanceUrl as authoritative params; an app credential's request goes only to its own environment and a block environment that names another is refused. OAuth requests keep the block environment exactly as before. Dynamics 365 already matched instanceUrl against the block environment. - Save check: a Graph token reading the app's own service principal (no permission needed), plus Dataverse WhoAmI when an environment is set. Entra AADSTS codes map to actionable copy; runtime failures keep the shared invalid_credentials / provider_unavailable split. Tokens cache per credential, resource, and stored-secret version in an LRU. - Azure AD Reset password refuses app-only credentials: Graph does not support application permissions for resetPassword. - Connect dialog with tenant ID, client ID, environment URL, and the issuer/audience/subject to paste; docs page with per-mode setup. * fix(credentials): close wave 3 review findings on Microsoft app credentials - SharePoint selectors (workspace and organization paths) and knowledge connectors now pass the service they resolve for (the selector's own serviceId, the connector's declared auth provider), so a Microsoft app credential browses SharePoint with a Graph token instead of being refused. The resolution option is renamed from toolService to service; it is only ever set from server-side policy. - AADSTS700211 and 700212 are no longer mapped: Microsoft documents only 70021 and 700213 for federated credential mismatches. Other keyless refusals still name the mismatch. - DocuSign minter test mocks carry account_name, and the connector access-token test narrows its tokens with a guard instead of non-null assertions. * feat(credentials): keyless Google Cloud credentials via Workload Identity Federation A keyless mode of the existing Google service account credential (google-service-account) for Google Cloud APIs. JSON-key credentials, their connect flow, and their token minting are unchanged. - Flow: Sim signs a short-lived token for the credential's own subject with aud = the customer's provider resource name (https://iam.googleapis.com/projects/<number>/locations/global/ workloadIdentityPools/<pool>/providers/<provider>), exchanges it at sts.googleapis.com/v1/token (token-exchange, jwt subject token, cloud-platform scope, audience //iam.googleapis.com/...), then calls iamcredentials generateAccessToken for the service account with the tool's scopes and a 1h lifetime. Impersonation rather than direct federated access: some Cloud APIs reject federated tokens, and the service account keeps the same identity and roles a JSON key uses. - Inputs validated against Google's documented formats before any request: numeric project number, pool/provider IDs (4-32 [a-z0-9-], no gcp-), and a user-managed *.iam.gserviceaccount.com email, so nothing can steer the STS audience or IAM URL. Requests never follow redirects. - Scope: refuses domain-wide delegation (an impersonated user) and any service but BigQuery and Vertex AI before reading further or contacting Google, with a new shared unsupported_use code and copy pointing to a JSON key. Workspace blocks never offer the mode. - Save check: STS exchange, impersonation, and tokeninfo (no IAM role or enabled API needed), plus a probe that a subject no credential holds cannot impersonate the service account. Subject bound to the saving user with the signed proof; kept across reconnects. - STS/IAM failures map to actionable copy (provider settings, issuer reachability, the exact workloadIdentityUser binding) without Google's descriptions or any token; runtime keeps the invalid_credentials / provider_unavailable split. Tokens cache per credential, secret version, and scopes in an LRU. - Per-credential audiences: audiences.ts gains google without a fixed audience; the setup response omits audience for it and reports a keyless reconnect. Connect dialog shows the issuer, audience, subject, and filled-in gcloud commands (pool, OIDC provider with attribute condition on the subject, IAM binding); docs section added. * fix(credentials): close wave 4 review findings on keyless Google Cloud credentials - Drop the tokeninfo check: a token from generateAccessToken already proves the provider accepted Sim's token and the impersonation binding, and tokeninfo puts a live token in a query string. - Test that saving fails closed when the stray-subject pin probe hits an STS outage or an unreachable IAM endpoint. - Pass --project=<project number> on all three gcloud setup commands, drop the unused Resource Manager API from the docs, and raise the shared validation error for an empty scope list. * fix(credentials): keep Snowflake, Microsoft app, and Google keyless subjects unique The subject-uniqueness scan from #9866 covered only AWS and Databricks. It now also scans Snowflake, Microsoft app, and Google service account credentials, so no two live credentials of an owner hold one keyless subject. Their keyed secrets that carry no config (a Google JSON key, a Snowflake programmatic access token) hold no subject and no longer read as unreadable. The three keyless save paths report a newly bound subject so create checks it. * fix(credentials): close round-1 CI and review findings on alt auth - Knowledge connector tests expect the service now passed with Google service-account token requests; a new test proves a JSON-key mint signs the same request with or without it. - Re-record the tool-registry-boundary baseline: the keyless Snowflake, Microsoft app, and Google modules add 5 modules behind credential-service, which tipped credit-usage past its allowance on top of staging's drift. - Docs compatibility baseline: record the new code examples in the Google and Snowflake service account pages. - Generate the Microsoft certificate test fixture at run time instead of committing a PEM key and certificate. - A Microsoft app credential reconnect opens on keyless only when the stored credential is federated (the prepare step now reports it), like Snowflake; new connections still default to keyless. - TSDoc on the Google project number, pool/provider ID, and service account email validators. * fix(credentials): offer keyless Google setup only in a Google Cloud context Reconnecting a keyless Google service account from a Workspace integration (Gmail, Drive, ...) offered the keyless form, saving a credential that integration can never use. The dialog now offers keyless only for a Google Cloud service (new or reconnect) or on the credential's own page; from a Workspace integration it explains the credential works only with BigQuery and Vertex AI and does not save. The chat connect control passes its service so it gets the same gate. * test(credentials): match the stable part of the subject-in-use refusal |