Terminate the run as CANCELLED (a user/system abort stopped it mid-flight, not a failure and not a clean completion). Emits exitReason='aborted' so a cancelled run is distinguishable from one that finished — the persisted CompanyIntegrationRun has no 'Cancelled' status, so the artifact's ExitReason is the GQL-visible signal that the run was stopped early (partial state is still durable).
Optionalmessage: stringWrite a resumable checkpoint. resumableState should carry enough subsystem- specific data for the originating service to resume from this point.
Terminate the run as success.
Optionalmessage: stringEmit a generic event.
Optionaldata: Record<string, unknown>Terminate the run as failure.
Optionalcode: stringAwait all pending writes.
Optionalcounts: {Convenience helpers — sugared emit() for the common cases.
Optionalmessage: stringOptionaldata: Record<string, unknown>Optionalmessage: stringEmit a non-fatal warning. Carries a structured {stage, code, message, data}
payload that the reader aggregates into the run result's warnings[] rollup.
Unlike stageError, a warning never fails the run.
Optionaldata: Record<string, unknown>StaticnewOptionalprefix: stringStaticSetRegister (or clear, with no arg) the global publish hook. The server registers this at startup so every emitted event also fans out to the live GraphQL subscription, in addition to the durable JSONL artifact + the pollable tail query.
Optionalhook: IntegrationProgressPublishHook
Writes structured progress artifacts to
<rootDir>/<runID>/:Sequence numbers monotonic per emitter instance. Disk I/O is async and serialized via an internal promise chain — callers don't await; the emitter guarantees ordered writes. A flush() method awaits the queue when needed (test teardown, run completion).