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:
2026-05-06 10:23:25 +00:00
parent 513c006ce3
commit 8d5b97c67e
3 changed files with 4 additions and 1 deletions
@@ -54,6 +54,7 @@ export function createRoleModerator<M extends RoleMeta>(
}
const ctx: ThreadContext<M> = {
threadId: options.threadId,
start,
steps,
};
+2
View File
@@ -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>[];
};
+1 -1
View File
@@ -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,