Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/agents/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ export type {
WorkflowEmit,
} from "./workflow/types.js";
export type { WorkflowEngineOptions, WorkflowRunMeta } from "./workflow/engine.js";
export { ProviderStepExecutor } from "./workflow/provider-step-executor.js";
export type { ProviderStepExecutorOptions } from "./workflow/provider-step-executor.js";
export type {
AgentStepExecutor,
StepExecutionRequest,
StepExecutionResult,
} from "./workflow/step-executor.js";

// base
export type { AgentRunResult, AgentRuntimeControls } from "./agents/base.agent.js";
Expand Down
9 changes: 5 additions & 4 deletions packages/agents/src/orchestrator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
} from "../provider/mock.data.js";
import { SkillRegistry } from "../skills/registry.js";
import { WorkflowEngine } from "../workflow/engine.js";
import type { AgentStepExecutor } from "../workflow/step-executor.js";
import { selectWorkflow } from "../workflow/router.js";
import type { WorkflowDefinition, WorkflowState } from "../workflow/types.js";

Expand All @@ -38,6 +39,8 @@ export type OrchestratorOptions = {
emit: (event: SSEEvent) => void;
provider: LLMProvider;
cache: AgentCache;
/** Overrides the default provider-backed step execution (mock/replay testing). */
executor?: AgentStepExecutor;
};

type ResolvedExecution = {
Expand Down Expand Up @@ -588,7 +591,7 @@ async function getSkillRegistry(): Promise<SkillRegistry> {
}

export async function runOrchestrator(options: OrchestratorOptions): Promise<Blueprint> {
const { jobId, prompt, projectName, execution, emit, provider, cache } = options;
const { jobId, prompt, projectName, execution, emit, provider, cache, executor } = options;
const resolvedExecution = resolveExecution(execution);
const skillRegistry = await getSkillRegistry();

Expand All @@ -598,10 +601,8 @@ export async function runOrchestrator(options: OrchestratorOptions): Promise<Blu
const workflowEngine = new WorkflowEngine({
jobId,
userGoal: prompt,
provider,
cache,
emit,
skillRegistry,
...(executor !== undefined ? { executor } : { provider, cache, skillRegistry }),
});

const finalState = await workflowEngine.run(selectedWorkflow, {
Expand Down
Loading
Loading