# Interface PipelinePlugin

Plugin interface — every stage implementation must conform.

Plugins are the ONLY way stage logic runs. They communicate via ArtifactStore and EventBus (injected via context).

interface PipelinePlugin {
manifest: {
id: string;
version: string;
description: string;
stages: (
"analyze"
| "validate"
| "aggregate"
| "execute"
| "gate"
| "route"
)[];
requiredCapabilities: string[];
trustLevel: "external" | "standard" | "core" | "experimental";
experimental: boolean;
};
execute(
stage: {
id: string;
type: "analyze" | "validate" | "aggregate" | "execute" | "gate" | "route";
pluginId: string;
inputArtifacts: string[];
outputArtifacts: string[];
dependencies: string[];
config: Record<string, unknown>;
preferredCli?: string;
maxRetries?: number;
timeoutMs?: number;
},
context: StageContext,
): Promise<
{
success: boolean;
outputArtifacts: {
id: string;
type: | "code"
| "plan"
| "analysis"
| "review"
| "test"
| "spec"
| "report"
| "vote";
}[];
metadata: Record<string, unknown>;
error?: string;
},
>;
validateConfig(config: unknown): Result<void, PluginValidationError>;
onLoad?(): Promise<void>;
onUnload?(): Promise<void>;
}

- Defined in packages/nexus-agents/src/pipeline/plugin-types.ts:86

##### Index

### Properties

manifest

### Methods

execute
validateConfig
onLoad?
onUnload?

## Properties

### `Readonly` manifest

manifest: {
id: string;
version: string;
description: string;
stages: (
"analyze"
| "validate"
| "aggregate"
| "execute"
| "gate"
| "route"
)[];
requiredCapabilities: string[];
trustLevel: "external" | "standard" | "core" | "experimental";
experimental: boolean;
}

Manifest declaring this plugin's identity and capabilities.

- Defined in packages/nexus-agents/src/pipeline/plugin-types.ts:88

## Methods

### execute

- execute(
  stage: {
  id: string;
  type: "analyze" | "validate" | "aggregate" | "execute" | "gate" | "route";
  pluginId: string;
  inputArtifacts: string[];
  outputArtifacts: string[];
  dependencies: string[];
  config: Record<string, unknown>;
  preferredCli?: string;
  maxRetries?: number;
  timeoutMs?: number;
  },
  context: StageContext,
  ): Promise<
  {
  success: boolean;
  outputArtifacts: {
  id: string;
  type: | "code"
  | "plan"
  | "analysis"
  | "review"
  | "test"
  | "spec"
  | "report"
  | "vote";
  }[];
  metadata: Record<string, unknown>;
  error?: string;
  },
  >

  Execute a pipeline stage.

  #### Parameters

  - stage: {
    id: string;
    type: "analyze" | "validate" | "aggregate" | "execute" | "gate" | "route";
    pluginId: string;
    inputArtifacts: string[];
    outputArtifacts: string[];
    dependencies: string[];
    config: Record<string, unknown>;
    preferredCli?: string;
    maxRetries?: number;
    timeoutMs?: number;
    }

    The stage specification from the PlanContract

  - context: StageContext

    Runtime context with abort signal and task

  #### Returns Promise<
  {
  success: boolean;
  outputArtifacts: {
  id: string;
  type: | "code"
  | "plan"
  | "analysis"
  | "review"
  | "test"
  | "spec"
  | "report"
  | "vote";
  }[];
  metadata: Record<string, unknown>;
  error?: string;
  },
  >

  Stage result with output artifacts

  - Defined in packages/nexus-agents/src/pipeline/plugin-types.ts:96

### validateConfig

- validateConfig(config: unknown): Result<void, PluginValidationError>

  Validate plugin configuration at registration time. Called once when the plugin is registered, not per-execution.

  #### Parameters

  - config: unknown

  #### Returns Result<void, PluginValidationError>

  - Defined in packages/nexus-agents/src/pipeline/plugin-types.ts:102

### `Optional` onLoad

- onLoad?(): Promise<void>

  Optional lifecycle hook — called when plugin is loaded.

  #### Returns Promise<void>

  - Defined in packages/nexus-agents/src/pipeline/plugin-types.ts:105

### `Optional` onUnload

- onUnload?(): Promise<void>

  Optional lifecycle hook — called when plugin is unloaded.

  #### Returns Promise<void>

  - Defined in packages/nexus-agents/src/pipeline/plugin-types.ts:108