Skip to content

AIDK API Reference / aidk-kernel / context

Function: context() ​

ts
function context(ctx: Partial<KernelContext>): Partial<KernelContext> & {
  [KERNEL_CONTEXT_SYMBOL]: true;
};

Defined in: packages/kernel/src/context.ts:524

Brand a context object with a Symbol for deterministic detection. This allows procedures to deterministically identify context vs regular args.

Parameters ​

ParameterType
ctxPartial<KernelContext>

Returns ​

Partial<KernelContext> & { [KERNEL_CONTEXT_SYMBOL]: true; }

Example ​

typescript
await proc(input, agent, context({ traceId: "123" }));

Released under the MIT License.