events.iterate.com

Event type

events.iterate.com/capability-host/script-run-requested

A script should run in this capability scope. Before any attempt starts, the code is typechecked against the scope's capability types: a script with a PROVABLE error — a syntax error, or a near-miss typo where the compiler names the fix ("Did you mean 'get'?") — settles straight to an error completion carrying the compiler errors, without ever running (no started event). Everything less certain runs: capabilities are provided dynamically and declared types can lag the runtime, so bare property/argument mismatches, unknown/untyped capabilities, non-async block shapes, and checker failures all let the script run unchecked.

Payload schema

codestring

The TypeScript script source to run.

executionIdstring

Caller-supplied obligation identity — the cross-stream correlation key the settlement points back at, and what every settle idempotency key derives from.

expiresAtinteger

Absolute epoch-ms deadline for typecheck, start, and execution. Recovery can deliver this request arbitrarily late; past the deadline it settles expired instead of running.

Raw JSON schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "The TypeScript script source to run."
    },
    "executionId": {
      "type": "string",
      "description": "Caller-supplied obligation identity — the cross-stream correlation key the settlement points back at, and what every settle idempotency key derives from."
    },
    "expiresAt": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "Absolute epoch-ms deadline for typecheck, start, and execution. Recovery can deliver this request arbitrarily late; past the deadline it settles expired instead of running."
    }
  },
  "required": [
    "code",
    "executionId",
    "expiresAt"
  ],
  "additionalProperties": false
}