Almost every orchestrion integration in packages/server-utils/src/integrations/ defines its own *ChannelContext interface. About 29 files have one (for example typesafe.ts, google-genai.ts, postgres.ts, dataloader.ts, amqplib.ts, mastra-classifier.ts).
All of them describe the same orchestrion payload: arguments: unknown[], plus some of self?, result?, error? and moduleVersion?. Some integrations make the types narrower (for example self?: KnexRunner or arguments: [TediousRequest?, ...unknown[]]).
Add one generic type in orchestrion/ (for example OrchestrionChannelContext<TArgs = unknown[], TSelf = unknown, TResult = unknown>) and use it in the integrations. Integrations that need more fields can extend it.
Found in review: #25044 (comment)
Almost every orchestrion integration in
packages/server-utils/src/integrations/defines its own*ChannelContextinterface. About 29 files have one (for exampletypesafe.ts,google-genai.ts,postgres.ts,dataloader.ts,amqplib.ts,mastra-classifier.ts).All of them describe the same orchestrion payload:
arguments: unknown[], plus some ofself?,result?,error?andmoduleVersion?. Some integrations make the types narrower (for exampleself?: KnexRunnerorarguments: [TediousRequest?, ...unknown[]]).Add one generic type in
orchestrion/(for exampleOrchestrionChannelContext<TArgs = unknown[], TSelf = unknown, TResult = unknown>) and use it in the integrations. Integrations that need more fields can extend it.Found in review: #25044 (comment)