feat: add threadId to ThreadContext and WorkflowFnOptions
Agentic roles can now access ctx.threadId to query thread details via uncaged-workflow CLI for richer context.
This commit is contained in:
@@ -54,6 +54,7 @@ export function createRoleModerator<M extends RoleMeta>(
|
||||
}
|
||||
|
||||
const ctx: ThreadContext<M> = {
|
||||
threadId: options.threadId,
|
||||
start,
|
||||
steps,
|
||||
};
|
||||
|
||||
@@ -26,6 +26,7 @@ export type ThreadInput = {
|
||||
|
||||
/** Options passed to a workflow bundle's `run` export (engine-provided). */
|
||||
export type WorkflowFnOptions = {
|
||||
threadId: string;
|
||||
isDryRun: boolean;
|
||||
maxRounds: number;
|
||||
};
|
||||
@@ -57,6 +58,7 @@ export type RoleStep<M extends RoleMeta> = {
|
||||
|
||||
/** Thread-scoped context passed to roles and moderator. */
|
||||
export type ThreadContext<M extends RoleMeta = RoleMeta> = {
|
||||
threadId: string;
|
||||
start: StartStep;
|
||||
steps: RoleStep<M>[];
|
||||
};
|
||||
|
||||
@@ -136,7 +136,7 @@ function parseRunControlPayload(rec: Record<string, unknown>): RunCommand | null
|
||||
threadId,
|
||||
workflowName,
|
||||
prompt,
|
||||
options: { isDryRun, maxRounds },
|
||||
options: { threadId, isDryRun, maxRounds },
|
||||
steps: parsedSteps.steps,
|
||||
stepTimestamps: parsedSteps.stepTimestamps,
|
||||
forkSourceThreadId,
|
||||
|
||||
Reference in New Issue
Block a user