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> = {
|
const ctx: ThreadContext<M> = {
|
||||||
|
threadId: options.threadId,
|
||||||
start,
|
start,
|
||||||
steps,
|
steps,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export type ThreadInput = {
|
|||||||
|
|
||||||
/** Options passed to a workflow bundle's `run` export (engine-provided). */
|
/** Options passed to a workflow bundle's `run` export (engine-provided). */
|
||||||
export type WorkflowFnOptions = {
|
export type WorkflowFnOptions = {
|
||||||
|
threadId: string;
|
||||||
isDryRun: boolean;
|
isDryRun: boolean;
|
||||||
maxRounds: number;
|
maxRounds: number;
|
||||||
};
|
};
|
||||||
@@ -57,6 +58,7 @@ export type RoleStep<M extends RoleMeta> = {
|
|||||||
|
|
||||||
/** Thread-scoped context passed to roles and moderator. */
|
/** Thread-scoped context passed to roles and moderator. */
|
||||||
export type ThreadContext<M extends RoleMeta = RoleMeta> = {
|
export type ThreadContext<M extends RoleMeta = RoleMeta> = {
|
||||||
|
threadId: string;
|
||||||
start: StartStep;
|
start: StartStep;
|
||||||
steps: RoleStep<M>[];
|
steps: RoleStep<M>[];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ function parseRunControlPayload(rec: Record<string, unknown>): RunCommand | null
|
|||||||
threadId,
|
threadId,
|
||||||
workflowName,
|
workflowName,
|
||||||
prompt,
|
prompt,
|
||||||
options: { isDryRun, maxRounds },
|
options: { threadId, isDryRun, maxRounds },
|
||||||
steps: parsedSteps.steps,
|
steps: parsedSteps.steps,
|
||||||
stepTimestamps: parsedSteps.stepTimestamps,
|
stepTimestamps: parsedSteps.stepTimestamps,
|
||||||
forkSourceThreadId,
|
forkSourceThreadId,
|
||||||
|
|||||||
Reference in New Issue
Block a user