@directive-run/ai 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { G as GuardrailFn, I as InputGuardrailData, O as OutputGuardrailData, S as SchemaValidator, T as ToolCallGuardrailData, A as AgentLike, M as Message, a as AdapterHooks, b as AgentRunner, c as ApprovalState, d as AgentState, R as RunOptions, e as RunResult, D as DebugEvent, B as BreakpointState, f as GoalResult } from './types-Co4BzMiH.cjs';
2
- export { g as AgentCircuitBreakerConfig, h as AgentCompleteEvent, i as AgentErrorEvent, j as AgentHealthState, k as AgentRetryConfig, l as AgentRetryEvent, m as AgentSelectionStrategy, n as AgentStartEvent, o as ApprovalRequest, p as ApprovalRequestEvent, q as ApprovalResponseEvent, r as BreakpointConfig, s as BreakpointContext, t as BreakpointHitEvent, u as BreakpointModifications, v as BreakpointRequest, w as BreakpointResumedEvent, x as BreakpointState, y as BreakpointType, C as Checkpoint, z as CheckpointContext, E as CheckpointDiff, F as CheckpointLocalState, H as CheckpointProgress, J as CheckpointRestoreEvent, K as CheckpointSaveEvent, L as CheckpointStore, N as ConstraintEvaluateEvent, P as CrossAgentDerivationFn, Q as CrossAgentSnapshot, U as DagCheckpointState, V as DagExecutionContext, W as DagNode, X as DagNodeStatus, Y as DagNodeUpdateEvent, Z as DagPattern, _ as DebateCheckpointState, $ as DebateRoundEvent, a0 as DebugEventBase, a1 as DebugEventType, a2 as DerivationUpdateEvent, a3 as GoalCheckpointConfig, a4 as GoalCheckpointState, a5 as GoalMetrics, a6 as GoalNode, a7 as GoalPattern, a8 as GoalStepMetrics, a9 as GuardrailCheckEvent, aa as GuardrailContext, ab as GuardrailError, ac as GuardrailErrorCode, ad as GuardrailResult, ae as GuardrailRetryConfig, af as GuardrailsConfig, ag as HandoffCompleteEvent, ah as HandoffStartEvent, ai as HealthMonitorConfig, aj as InMemoryCheckpointStore, ak as InMemoryCheckpointStoreOptions, al as MAX_BREAKPOINT_HISTORY, am as MultiAgentBreakpointType, an as MultiAgentCheckpointLocalState, ao as MultiAgentLifecycleHooks, ap as MultiAgentSelfHealingConfig, aq as NamedGuardrail, ar as OrchestratorConstraint, as as OrchestratorDebugConfig, at as OrchestratorLifecycleHooks, au as OrchestratorResolver, av as OrchestratorResolverContext, aw as OrchestratorState, ax as PatternCheckpointBase, ay as PatternCheckpointConfig, az as PatternCheckpointState, aA as PatternCompleteEvent, aB as PatternStartEvent, aC as RaceCancelledEvent, aD as RaceStartEvent, aE as RaceWinnerEvent, aF as ReflectCheckpointState, aG as ReflectionIterationEvent, aH as RejectedRequest, aI as RelaxationContext, aJ as RelaxationRecord, aK as RelaxationStrategy, aL as RelaxationTier, aM as RerouteDebugEvent, aN as RerouteEvent, aO as ResolverCompleteEvent, aP as ResolverErrorEvent, aQ as ResolverStartEvent, aR as SchemaValidationResult, aS as Scratchpad, aT as ScratchpadUpdateEvent, aU as SelfHealingConfig, aV as SequentialCheckpointState, aW as SingleAgentCheckpointLocalState, aX as StreamingCallbackRunner, aY as SupervisorCheckpointState, aZ as TokenUsage, a_ as ToolCall, a$ as createBreakpointId, b0 as createCheckpointId, b1 as createInitialBreakpointState, b2 as isGuardrailError, b3 as matchBreakpoint, b4 as validateCheckpoint } from './types-Co4BzMiH.cjs';
3
- import { E as ExecutionPattern, S as SerializedPattern, A as AgentHealthMetrics, D as DebugTimeline, H as HealthMonitor } from './multi-agent-orchestrator-CxL8ycw_.cjs';
4
- export { a as AgentMemory, b as AgentMemoryConfig, c as AgentOrchestrator, d as AgentRegistration, e as AgentRegistry, B as BackpressureStrategy, f as DebateConfig, g as DebatePattern, h as DebateResult, i as DebugTimelineListener, j as DebugTimelineOptions, k as DoneChunk, l as ErrorChunk, G as GuardrailTriggeredChunk, m as HandoffRequest, n as HandoffResult, o as HealthCircuitState, M as MemoryManageResult, p as MemoryState, q as MemoryStrategy, r as MemoryStrategyConfig, s as MemoryStrategyResult, t as MergedTaggedStreamResult, u as MessageChunk, v as MessageSummarizer, w as MultiAgentOrchestrator, x as MultiAgentOrchestratorOptions, y as MultiAgentRunCallOptions, z as MultiAgentState, C as MultiplexedStreamChunk, F as MultiplexedStreamResult, O as OrchestratorOptions, I as OrchestratorStreamChunk, J as OrchestratorStreamResult, P as ParallelPattern, K as ProgressChunk, R as RacePattern, L as RaceResult, N as RaceSuccessEntry, Q as ReflectIterationRecord, T as ReflectPattern, U as ReflectionConfig, V as ReflectionContext, W as ReflectionEvaluation, X as ReflectionEvaluator, Y as ReflectionExhaustedError, Z as RunAgentRequirement, _ as RunCallOptions, $ as SafeParseResult, a0 as SafeParseable, a1 as Semaphore, a2 as SequentialPattern, a3 as SerializedDagNode, a4 as SerializedGoalNode, a5 as SpawnOnConditionOptions, a6 as SpawnPoolConfig, a7 as StreamChunk, a8 as StreamRunOptions, a9 as StreamRunner, aa as StreamingGuardrail, ab as StreamingGuardrailResult, ac as StreamingRunResult, ad as StructuredOutputConfig, ae as StructuredOutputError, af as SupervisorPattern, ag as TokenChunk, ah as ToolEndChunk, ai as ToolStartChunk, aj as adaptOutputGuardrail, ak as aggregateTokens, al as allReadyStrategy, am as capabilityRoute, an as collectOutputs, ao as collectTokens, ap as combineStreamingGuardrails, aq as composePatterns, ar as concatResults, as as costEfficientStrategy, at as createAgentMemory, au as createAgentOrchestrator, av as createDebugTimeline, aw as createDebugTimelinePlugin, ax as createHealthMonitor, ay as createHybridStrategy, az as createKeyPointsSummarizer, aA as createLLMSummarizer, aB as createLengthStreamingGuardrail, aC as createMultiAgentOrchestrator, aD as createPatternStreamingGuardrail, aE as createSlidingWindowStrategy, aF as createStreamingRunner, aG as createTokenBasedStrategy, aH as createToxicityStreamingGuardrail, aI as createTruncationSummarizer, aJ as dag, aK as debate, aL as derivedConstraint, aM as diffCheckpoints, aN as extractJsonFromOutput, aO as filterStream, aP as findAgentsByCapability, aQ as forkFromCheckpoint, aR as getCheckpointProgress, aS as getPatternStep, aT as goal, aU as highestImpactStrategy, aV as mapStream, aW as mergeTaggedStreams, aX as parallel, aY as patternFromJSON, aZ as patternToJSON, a_ as pickBestResult, a$ as race, b0 as reflect, b1 as runAgentRequirement, b2 as runDebate, b3 as selectAgent, b4 as sequential, b5 as spawnOnCondition, b6 as spawnPool, b7 as supervisor, b8 as tapStream, b9 as withReflection, ba as withStructuredOutput } from './multi-agent-orchestrator-CxL8ycw_.cjs';
1
+ import { G as GuardrailFn, I as InputGuardrailData, O as OutputGuardrailData, S as SchemaValidator, T as ToolCallGuardrailData, A as AgentLike, M as Message, a as AdapterHooks, b as AgentRunner, c as ApprovalState, d as AgentState, R as RunOptions, e as RunResult, D as DebugEvent, B as BreakpointState, f as GoalResult } from './types-D5veI9su.cjs';
2
+ export { g as AgentCircuitBreakerConfig, h as AgentCompleteEvent, i as AgentErrorEvent, j as AgentHealthState, k as AgentRetryConfig, l as AgentRetryEvent, m as AgentSelectionStrategy, n as AgentStartEvent, o as ApprovalRequest, p as ApprovalRequestEvent, q as ApprovalResponseEvent, r as BreakpointConfig, s as BreakpointContext, t as BreakpointHitEvent, u as BreakpointModifications, v as BreakpointRequest, w as BreakpointResumedEvent, x as BreakpointState, y as BreakpointType, C as Checkpoint, z as CheckpointContext, E as CheckpointDiff, F as CheckpointLocalState, H as CheckpointProgress, J as CheckpointRestoreEvent, K as CheckpointSaveEvent, L as CheckpointStore, N as ConstraintEvaluateEvent, P as CrossAgentDerivationFn, Q as CrossAgentSnapshot, U as DagCheckpointState, V as DagExecutionContext, W as DagNode, X as DagNodeStatus, Y as DagNodeUpdateEvent, Z as DagPattern, _ as DebateCheckpointState, $ as DebateRoundEvent, a0 as DebugEventBase, a1 as DebugEventType, a2 as DerivationUpdateEvent, a3 as GoalCheckpointConfig, a4 as GoalCheckpointState, a5 as GoalMetrics, a6 as GoalNode, a7 as GoalPattern, a8 as GoalStepMetrics, a9 as GuardrailCheckEvent, aa as GuardrailContext, ab as GuardrailError, ac as GuardrailErrorCode, ad as GuardrailResult, ae as GuardrailRetryConfig, af as GuardrailsConfig, ag as HandoffCompleteEvent, ah as HandoffStartEvent, ai as HealthMonitorConfig, aj as InMemoryCheckpointStore, ak as InMemoryCheckpointStoreOptions, al as MAX_BREAKPOINT_HISTORY, am as MultiAgentBreakpointType, an as MultiAgentCheckpointLocalState, ao as MultiAgentLifecycleHooks, ap as MultiAgentSelfHealingConfig, aq as NamedGuardrail, ar as OrchestratorConstraint, as as OrchestratorDebugConfig, at as OrchestratorLifecycleHooks, au as OrchestratorResolver, av as OrchestratorResolverContext, aw as OrchestratorState, ax as PatternCheckpointBase, ay as PatternCheckpointConfig, az as PatternCheckpointState, aA as PatternCompleteEvent, aB as PatternStartEvent, aC as RaceCancelledEvent, aD as RaceStartEvent, aE as RaceWinnerEvent, aF as ReflectCheckpointState, aG as ReflectionIterationEvent, aH as RejectedRequest, aI as RelaxationContext, aJ as RelaxationRecord, aK as RelaxationStrategy, aL as RelaxationTier, aM as RerouteDebugEvent, aN as RerouteEvent, aO as ResolverCompleteEvent, aP as ResolverErrorEvent, aQ as ResolverStartEvent, aR as SchemaValidationResult, aS as Scratchpad, aT as ScratchpadUpdateEvent, aU as SelfHealingConfig, aV as SequentialCheckpointState, aW as SingleAgentCheckpointLocalState, aX as StreamingCallbackRunner, aY as SupervisorCheckpointState, aZ as TaskCompleteEvent, a_ as TaskErrorEvent, a$ as TaskProgressEvent, b0 as TaskStartEvent, b1 as TokenUsage, b2 as ToolCall, b3 as createBreakpointId, b4 as createCheckpointId, b5 as createInitialBreakpointState, b6 as isGuardrailError, b7 as matchBreakpoint, b8 as validateCheckpoint } from './types-D5veI9su.cjs';
3
+ import { E as ExecutionPattern, S as SerializedPattern, A as AgentHealthMetrics, D as DebugTimeline, H as HealthMonitor } from './multi-agent-orchestrator-YFs28JsF.cjs';
4
+ export { a as AgentMemory, b as AgentMemoryConfig, c as AgentOrchestrator, d as AgentRegistration, e as AgentRegistry, B as BackpressureStrategy, f as DebateConfig, g as DebatePattern, h as DebateResult, i as DebugTimelineListener, j as DebugTimelineOptions, k as DoneChunk, l as ErrorChunk, G as GuardrailTriggeredChunk, m as HandoffRequest, n as HandoffResult, o as HealthCircuitState, M as MemoryManageResult, p as MemoryState, q as MemoryStrategy, r as MemoryStrategyConfig, s as MemoryStrategyResult, t as MergedTaggedStreamResult, u as MessageChunk, v as MessageSummarizer, w as MultiAgentOrchestrator, x as MultiAgentOrchestratorOptions, y as MultiAgentRunCallOptions, z as MultiAgentState, C as MultiplexedStreamChunk, F as MultiplexedStreamResult, O as OrchestratorOptions, I as OrchestratorStreamChunk, J as OrchestratorStreamResult, P as ParallelPattern, K as ProgressChunk, R as RacePattern, L as RaceResult, N as RaceSuccessEntry, Q as ReflectIterationRecord, T as ReflectPattern, U as ReflectionConfig, V as ReflectionContext, W as ReflectionEvaluation, X as ReflectionEvaluator, Y as ReflectionExhaustedError, Z as RunAgentRequirement, _ as RunCallOptions, $ as SafeParseResult, a0 as SafeParseable, a1 as Semaphore, a2 as SequentialPattern, a3 as SerializedDagNode, a4 as SerializedGoalNode, a5 as SpawnOnConditionOptions, a6 as SpawnPoolConfig, a7 as StreamChunk, a8 as StreamRunOptions, a9 as StreamRunner, aa as StreamingGuardrail, ab as StreamingGuardrailResult, ac as StreamingRunResult, ad as StructuredOutputConfig, ae as StructuredOutputError, af as SupervisorPattern, ag as TaskContext, ah as TaskRegistration, ai as TokenChunk, aj as ToolEndChunk, ak as ToolStartChunk, al as adaptOutputGuardrail, am as aggregateTokens, an as allReadyStrategy, ao as capabilityRoute, ap as collectOutputs, aq as collectTokens, ar as combineStreamingGuardrails, as as composePatterns, at as concatResults, au as costEfficientStrategy, av as createAgentMemory, aw as createAgentOrchestrator, ax as createDebugTimeline, ay as createDebugTimelinePlugin, az as createHealthMonitor, aA as createHybridStrategy, aB as createKeyPointsSummarizer, aC as createLLMSummarizer, aD as createLengthStreamingGuardrail, aE as createMultiAgentOrchestrator, aF as createPatternStreamingGuardrail, aG as createSlidingWindowStrategy, aH as createStreamingRunner, aI as createTokenBasedStrategy, aJ as createToxicityStreamingGuardrail, aK as createTruncationSummarizer, aL as dag, aM as debate, aN as derivedConstraint, aO as diffCheckpoints, aP as extractJsonFromOutput, aQ as filterStream, aR as findAgentsByCapability, aS as forkFromCheckpoint, aT as getCheckpointProgress, aU as getPatternStep, aV as goal, aW as highestImpactStrategy, aX as mapStream, aY as mergeTaggedStreams, aZ as parallel, a_ as patternFromJSON, a$ as patternToJSON, b0 as pickBestResult, b1 as race, b2 as reflect, b3 as runAgentRequirement, b4 as runDebate, b5 as selectAgent, b6 as sequential, b7 as spawnOnCondition, b8 as spawnPool, b9 as supervisor, ba as tapStream, bb as withReflection, bc as withStructuredOutput } from './multi-agent-orchestrator-YFs28JsF.cjs';
5
5
  export { AggregatedMetric, AlertConfig, AlertEvent, CircuitBreaker, CircuitBreakerConfig, CircuitBreakerOpenError, CircuitBreakerStats, CircuitState, DashboardData, MetricDataPoint, MetricType, OTLPExporter, OTLPExporterConfig, ObservabilityConfig, ObservabilityInstance, TraceSpan, createAgentMetrics, createCircuitBreaker, createOTLPExporter, createObservability } from '@directive-run/core/plugins';
6
6
  import { ModuleSchema, Plugin } from '@directive-run/core';
7
7
  import { E as Embedding, a as EmbedderFn } from './semantic-cache-F0psCRuz.cjs';
@@ -250,6 +250,8 @@ type MermaidDirection = "LR" | "TD" | "TB" | "RL" | "BT";
250
250
  interface MermaidNodeShapes {
251
251
  /** Shape for agent nodes. @default "square" */
252
252
  agent?: "square" | "round" | "stadium" | "hexagon";
253
+ /** Shape for task nodes. @default "hexagon" */
254
+ task?: "square" | "round" | "stadium" | "hexagon";
253
255
  /** Shape for virtual nodes (Input, Output, Merge). @default "circle" */
254
256
  virtual?: "circle" | "square" | "round" | "stadium";
255
257
  }
@@ -260,6 +262,8 @@ interface MermaidOptions {
260
262
  theme?: "default" | "dark" | "forest" | "neutral";
261
263
  /** Node shape overrides. */
262
264
  shapes?: MermaidNodeShapes;
265
+ /** Set of task IDs — used to render task nodes with distinct shapes. */
266
+ taskIds?: ReadonlySet<string>;
263
267
  }
264
268
  /**
265
269
  * Convert an execution pattern to a Mermaid diagram string.
@@ -270,7 +274,7 @@ interface MermaidOptions {
270
274
  *
271
275
  * @example
272
276
  * ```typescript
273
- * const p = dag({ fetch: { agent: "fetcher" }, report: { agent: "reporter", deps: ["fetch"] } });
277
+ * const p = dag({ fetch: { handler: "fetcher" }, report: { handler: "reporter", deps: ["fetch"] } });
274
278
  * console.log(patternToMermaid(p, { direction: "TD" }));
275
279
  * // graph TD
276
280
  * // fetch[fetcher]
@@ -808,7 +812,7 @@ declare function detectPII(text: string, options?: {
808
812
  * ```
809
813
  */
810
814
 
811
- /** Audit event types - 17 total covering all system operations */
815
+ /** Audit event types - 22 total covering all system operations */
812
816
  type AuditEventType = "agent.run.start" | "agent.run.complete" | "agent.run.error" | "tool.call.start" | "tool.call.complete" | "tool.call.error" | "approval.requested" | "approval.granted" | "approval.denied" | "requirement.created" | "requirement.met" | "resolver.start" | "resolver.complete" | "resolver.error" | "fact.set" | "fact.batch" | "error.occurred" | "error.recovery" | "checkpoint.save" | "checkpoint.restore" | "checkpoint.fork" | "checkpoint.replay";
813
817
  /** Single audit entry with hash chain linking */
814
818
  interface AuditEntry {
@@ -2575,6 +2579,9 @@ type DevToolsServerMessage = {
2575
2579
  };
2576
2580
  /** Messages sent FROM clients TO the server */
2577
2581
  type DevToolsClientMessage = {
2582
+ type: "authenticate";
2583
+ token: string;
2584
+ } | {
2578
2585
  type: "request_snapshot";
2579
2586
  } | {
2580
2587
  type: "request_health";
@@ -2661,6 +2668,8 @@ interface DevToolsServerConfig {
2661
2668
  healthPushIntervalMs?: number;
2662
2669
  /** Maximum connected clients. Default: 50 */
2663
2670
  maxClients?: number;
2671
+ /** Token authentication callback. When set, new connections must send an `authenticate` message before receiving data. */
2672
+ authenticate?: (token: string) => boolean | Promise<boolean>;
2664
2673
  }
2665
2674
  /** DevTools server instance */
2666
2675
  interface DevToolsServer {
@@ -2710,6 +2719,8 @@ interface ConnectDevToolsOptions {
2710
2719
  healthPushIntervalMs?: number;
2711
2720
  /** Event batching size. Default: 1 (no batching) */
2712
2721
  batchSize?: number;
2722
+ /** Token authentication callback. When set, clients must authenticate before receiving data. */
2723
+ authenticate?: (token: string) => boolean | Promise<boolean>;
2713
2724
  }
2714
2725
  /** Minimal orchestrator interface for DevTools connection */
2715
2726
  interface DevToolsCompatibleOrchestrator {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { G as GuardrailFn, I as InputGuardrailData, O as OutputGuardrailData, S as SchemaValidator, T as ToolCallGuardrailData, A as AgentLike, M as Message, a as AdapterHooks, b as AgentRunner, c as ApprovalState, d as AgentState, R as RunOptions, e as RunResult, D as DebugEvent, B as BreakpointState, f as GoalResult } from './types-Co4BzMiH.js';
2
- export { g as AgentCircuitBreakerConfig, h as AgentCompleteEvent, i as AgentErrorEvent, j as AgentHealthState, k as AgentRetryConfig, l as AgentRetryEvent, m as AgentSelectionStrategy, n as AgentStartEvent, o as ApprovalRequest, p as ApprovalRequestEvent, q as ApprovalResponseEvent, r as BreakpointConfig, s as BreakpointContext, t as BreakpointHitEvent, u as BreakpointModifications, v as BreakpointRequest, w as BreakpointResumedEvent, x as BreakpointState, y as BreakpointType, C as Checkpoint, z as CheckpointContext, E as CheckpointDiff, F as CheckpointLocalState, H as CheckpointProgress, J as CheckpointRestoreEvent, K as CheckpointSaveEvent, L as CheckpointStore, N as ConstraintEvaluateEvent, P as CrossAgentDerivationFn, Q as CrossAgentSnapshot, U as DagCheckpointState, V as DagExecutionContext, W as DagNode, X as DagNodeStatus, Y as DagNodeUpdateEvent, Z as DagPattern, _ as DebateCheckpointState, $ as DebateRoundEvent, a0 as DebugEventBase, a1 as DebugEventType, a2 as DerivationUpdateEvent, a3 as GoalCheckpointConfig, a4 as GoalCheckpointState, a5 as GoalMetrics, a6 as GoalNode, a7 as GoalPattern, a8 as GoalStepMetrics, a9 as GuardrailCheckEvent, aa as GuardrailContext, ab as GuardrailError, ac as GuardrailErrorCode, ad as GuardrailResult, ae as GuardrailRetryConfig, af as GuardrailsConfig, ag as HandoffCompleteEvent, ah as HandoffStartEvent, ai as HealthMonitorConfig, aj as InMemoryCheckpointStore, ak as InMemoryCheckpointStoreOptions, al as MAX_BREAKPOINT_HISTORY, am as MultiAgentBreakpointType, an as MultiAgentCheckpointLocalState, ao as MultiAgentLifecycleHooks, ap as MultiAgentSelfHealingConfig, aq as NamedGuardrail, ar as OrchestratorConstraint, as as OrchestratorDebugConfig, at as OrchestratorLifecycleHooks, au as OrchestratorResolver, av as OrchestratorResolverContext, aw as OrchestratorState, ax as PatternCheckpointBase, ay as PatternCheckpointConfig, az as PatternCheckpointState, aA as PatternCompleteEvent, aB as PatternStartEvent, aC as RaceCancelledEvent, aD as RaceStartEvent, aE as RaceWinnerEvent, aF as ReflectCheckpointState, aG as ReflectionIterationEvent, aH as RejectedRequest, aI as RelaxationContext, aJ as RelaxationRecord, aK as RelaxationStrategy, aL as RelaxationTier, aM as RerouteDebugEvent, aN as RerouteEvent, aO as ResolverCompleteEvent, aP as ResolverErrorEvent, aQ as ResolverStartEvent, aR as SchemaValidationResult, aS as Scratchpad, aT as ScratchpadUpdateEvent, aU as SelfHealingConfig, aV as SequentialCheckpointState, aW as SingleAgentCheckpointLocalState, aX as StreamingCallbackRunner, aY as SupervisorCheckpointState, aZ as TokenUsage, a_ as ToolCall, a$ as createBreakpointId, b0 as createCheckpointId, b1 as createInitialBreakpointState, b2 as isGuardrailError, b3 as matchBreakpoint, b4 as validateCheckpoint } from './types-Co4BzMiH.js';
3
- import { E as ExecutionPattern, S as SerializedPattern, A as AgentHealthMetrics, D as DebugTimeline, H as HealthMonitor } from './multi-agent-orchestrator-uMp8bLfV.js';
4
- export { a as AgentMemory, b as AgentMemoryConfig, c as AgentOrchestrator, d as AgentRegistration, e as AgentRegistry, B as BackpressureStrategy, f as DebateConfig, g as DebatePattern, h as DebateResult, i as DebugTimelineListener, j as DebugTimelineOptions, k as DoneChunk, l as ErrorChunk, G as GuardrailTriggeredChunk, m as HandoffRequest, n as HandoffResult, o as HealthCircuitState, M as MemoryManageResult, p as MemoryState, q as MemoryStrategy, r as MemoryStrategyConfig, s as MemoryStrategyResult, t as MergedTaggedStreamResult, u as MessageChunk, v as MessageSummarizer, w as MultiAgentOrchestrator, x as MultiAgentOrchestratorOptions, y as MultiAgentRunCallOptions, z as MultiAgentState, C as MultiplexedStreamChunk, F as MultiplexedStreamResult, O as OrchestratorOptions, I as OrchestratorStreamChunk, J as OrchestratorStreamResult, P as ParallelPattern, K as ProgressChunk, R as RacePattern, L as RaceResult, N as RaceSuccessEntry, Q as ReflectIterationRecord, T as ReflectPattern, U as ReflectionConfig, V as ReflectionContext, W as ReflectionEvaluation, X as ReflectionEvaluator, Y as ReflectionExhaustedError, Z as RunAgentRequirement, _ as RunCallOptions, $ as SafeParseResult, a0 as SafeParseable, a1 as Semaphore, a2 as SequentialPattern, a3 as SerializedDagNode, a4 as SerializedGoalNode, a5 as SpawnOnConditionOptions, a6 as SpawnPoolConfig, a7 as StreamChunk, a8 as StreamRunOptions, a9 as StreamRunner, aa as StreamingGuardrail, ab as StreamingGuardrailResult, ac as StreamingRunResult, ad as StructuredOutputConfig, ae as StructuredOutputError, af as SupervisorPattern, ag as TokenChunk, ah as ToolEndChunk, ai as ToolStartChunk, aj as adaptOutputGuardrail, ak as aggregateTokens, al as allReadyStrategy, am as capabilityRoute, an as collectOutputs, ao as collectTokens, ap as combineStreamingGuardrails, aq as composePatterns, ar as concatResults, as as costEfficientStrategy, at as createAgentMemory, au as createAgentOrchestrator, av as createDebugTimeline, aw as createDebugTimelinePlugin, ax as createHealthMonitor, ay as createHybridStrategy, az as createKeyPointsSummarizer, aA as createLLMSummarizer, aB as createLengthStreamingGuardrail, aC as createMultiAgentOrchestrator, aD as createPatternStreamingGuardrail, aE as createSlidingWindowStrategy, aF as createStreamingRunner, aG as createTokenBasedStrategy, aH as createToxicityStreamingGuardrail, aI as createTruncationSummarizer, aJ as dag, aK as debate, aL as derivedConstraint, aM as diffCheckpoints, aN as extractJsonFromOutput, aO as filterStream, aP as findAgentsByCapability, aQ as forkFromCheckpoint, aR as getCheckpointProgress, aS as getPatternStep, aT as goal, aU as highestImpactStrategy, aV as mapStream, aW as mergeTaggedStreams, aX as parallel, aY as patternFromJSON, aZ as patternToJSON, a_ as pickBestResult, a$ as race, b0 as reflect, b1 as runAgentRequirement, b2 as runDebate, b3 as selectAgent, b4 as sequential, b5 as spawnOnCondition, b6 as spawnPool, b7 as supervisor, b8 as tapStream, b9 as withReflection, ba as withStructuredOutput } from './multi-agent-orchestrator-uMp8bLfV.js';
1
+ import { G as GuardrailFn, I as InputGuardrailData, O as OutputGuardrailData, S as SchemaValidator, T as ToolCallGuardrailData, A as AgentLike, M as Message, a as AdapterHooks, b as AgentRunner, c as ApprovalState, d as AgentState, R as RunOptions, e as RunResult, D as DebugEvent, B as BreakpointState, f as GoalResult } from './types-D5veI9su.js';
2
+ export { g as AgentCircuitBreakerConfig, h as AgentCompleteEvent, i as AgentErrorEvent, j as AgentHealthState, k as AgentRetryConfig, l as AgentRetryEvent, m as AgentSelectionStrategy, n as AgentStartEvent, o as ApprovalRequest, p as ApprovalRequestEvent, q as ApprovalResponseEvent, r as BreakpointConfig, s as BreakpointContext, t as BreakpointHitEvent, u as BreakpointModifications, v as BreakpointRequest, w as BreakpointResumedEvent, x as BreakpointState, y as BreakpointType, C as Checkpoint, z as CheckpointContext, E as CheckpointDiff, F as CheckpointLocalState, H as CheckpointProgress, J as CheckpointRestoreEvent, K as CheckpointSaveEvent, L as CheckpointStore, N as ConstraintEvaluateEvent, P as CrossAgentDerivationFn, Q as CrossAgentSnapshot, U as DagCheckpointState, V as DagExecutionContext, W as DagNode, X as DagNodeStatus, Y as DagNodeUpdateEvent, Z as DagPattern, _ as DebateCheckpointState, $ as DebateRoundEvent, a0 as DebugEventBase, a1 as DebugEventType, a2 as DerivationUpdateEvent, a3 as GoalCheckpointConfig, a4 as GoalCheckpointState, a5 as GoalMetrics, a6 as GoalNode, a7 as GoalPattern, a8 as GoalStepMetrics, a9 as GuardrailCheckEvent, aa as GuardrailContext, ab as GuardrailError, ac as GuardrailErrorCode, ad as GuardrailResult, ae as GuardrailRetryConfig, af as GuardrailsConfig, ag as HandoffCompleteEvent, ah as HandoffStartEvent, ai as HealthMonitorConfig, aj as InMemoryCheckpointStore, ak as InMemoryCheckpointStoreOptions, al as MAX_BREAKPOINT_HISTORY, am as MultiAgentBreakpointType, an as MultiAgentCheckpointLocalState, ao as MultiAgentLifecycleHooks, ap as MultiAgentSelfHealingConfig, aq as NamedGuardrail, ar as OrchestratorConstraint, as as OrchestratorDebugConfig, at as OrchestratorLifecycleHooks, au as OrchestratorResolver, av as OrchestratorResolverContext, aw as OrchestratorState, ax as PatternCheckpointBase, ay as PatternCheckpointConfig, az as PatternCheckpointState, aA as PatternCompleteEvent, aB as PatternStartEvent, aC as RaceCancelledEvent, aD as RaceStartEvent, aE as RaceWinnerEvent, aF as ReflectCheckpointState, aG as ReflectionIterationEvent, aH as RejectedRequest, aI as RelaxationContext, aJ as RelaxationRecord, aK as RelaxationStrategy, aL as RelaxationTier, aM as RerouteDebugEvent, aN as RerouteEvent, aO as ResolverCompleteEvent, aP as ResolverErrorEvent, aQ as ResolverStartEvent, aR as SchemaValidationResult, aS as Scratchpad, aT as ScratchpadUpdateEvent, aU as SelfHealingConfig, aV as SequentialCheckpointState, aW as SingleAgentCheckpointLocalState, aX as StreamingCallbackRunner, aY as SupervisorCheckpointState, aZ as TaskCompleteEvent, a_ as TaskErrorEvent, a$ as TaskProgressEvent, b0 as TaskStartEvent, b1 as TokenUsage, b2 as ToolCall, b3 as createBreakpointId, b4 as createCheckpointId, b5 as createInitialBreakpointState, b6 as isGuardrailError, b7 as matchBreakpoint, b8 as validateCheckpoint } from './types-D5veI9su.js';
3
+ import { E as ExecutionPattern, S as SerializedPattern, A as AgentHealthMetrics, D as DebugTimeline, H as HealthMonitor } from './multi-agent-orchestrator-D-WuP4jP.js';
4
+ export { a as AgentMemory, b as AgentMemoryConfig, c as AgentOrchestrator, d as AgentRegistration, e as AgentRegistry, B as BackpressureStrategy, f as DebateConfig, g as DebatePattern, h as DebateResult, i as DebugTimelineListener, j as DebugTimelineOptions, k as DoneChunk, l as ErrorChunk, G as GuardrailTriggeredChunk, m as HandoffRequest, n as HandoffResult, o as HealthCircuitState, M as MemoryManageResult, p as MemoryState, q as MemoryStrategy, r as MemoryStrategyConfig, s as MemoryStrategyResult, t as MergedTaggedStreamResult, u as MessageChunk, v as MessageSummarizer, w as MultiAgentOrchestrator, x as MultiAgentOrchestratorOptions, y as MultiAgentRunCallOptions, z as MultiAgentState, C as MultiplexedStreamChunk, F as MultiplexedStreamResult, O as OrchestratorOptions, I as OrchestratorStreamChunk, J as OrchestratorStreamResult, P as ParallelPattern, K as ProgressChunk, R as RacePattern, L as RaceResult, N as RaceSuccessEntry, Q as ReflectIterationRecord, T as ReflectPattern, U as ReflectionConfig, V as ReflectionContext, W as ReflectionEvaluation, X as ReflectionEvaluator, Y as ReflectionExhaustedError, Z as RunAgentRequirement, _ as RunCallOptions, $ as SafeParseResult, a0 as SafeParseable, a1 as Semaphore, a2 as SequentialPattern, a3 as SerializedDagNode, a4 as SerializedGoalNode, a5 as SpawnOnConditionOptions, a6 as SpawnPoolConfig, a7 as StreamChunk, a8 as StreamRunOptions, a9 as StreamRunner, aa as StreamingGuardrail, ab as StreamingGuardrailResult, ac as StreamingRunResult, ad as StructuredOutputConfig, ae as StructuredOutputError, af as SupervisorPattern, ag as TaskContext, ah as TaskRegistration, ai as TokenChunk, aj as ToolEndChunk, ak as ToolStartChunk, al as adaptOutputGuardrail, am as aggregateTokens, an as allReadyStrategy, ao as capabilityRoute, ap as collectOutputs, aq as collectTokens, ar as combineStreamingGuardrails, as as composePatterns, at as concatResults, au as costEfficientStrategy, av as createAgentMemory, aw as createAgentOrchestrator, ax as createDebugTimeline, ay as createDebugTimelinePlugin, az as createHealthMonitor, aA as createHybridStrategy, aB as createKeyPointsSummarizer, aC as createLLMSummarizer, aD as createLengthStreamingGuardrail, aE as createMultiAgentOrchestrator, aF as createPatternStreamingGuardrail, aG as createSlidingWindowStrategy, aH as createStreamingRunner, aI as createTokenBasedStrategy, aJ as createToxicityStreamingGuardrail, aK as createTruncationSummarizer, aL as dag, aM as debate, aN as derivedConstraint, aO as diffCheckpoints, aP as extractJsonFromOutput, aQ as filterStream, aR as findAgentsByCapability, aS as forkFromCheckpoint, aT as getCheckpointProgress, aU as getPatternStep, aV as goal, aW as highestImpactStrategy, aX as mapStream, aY as mergeTaggedStreams, aZ as parallel, a_ as patternFromJSON, a$ as patternToJSON, b0 as pickBestResult, b1 as race, b2 as reflect, b3 as runAgentRequirement, b4 as runDebate, b5 as selectAgent, b6 as sequential, b7 as spawnOnCondition, b8 as spawnPool, b9 as supervisor, ba as tapStream, bb as withReflection, bc as withStructuredOutput } from './multi-agent-orchestrator-D-WuP4jP.js';
5
5
  export { AggregatedMetric, AlertConfig, AlertEvent, CircuitBreaker, CircuitBreakerConfig, CircuitBreakerOpenError, CircuitBreakerStats, CircuitState, DashboardData, MetricDataPoint, MetricType, OTLPExporter, OTLPExporterConfig, ObservabilityConfig, ObservabilityInstance, TraceSpan, createAgentMetrics, createCircuitBreaker, createOTLPExporter, createObservability } from '@directive-run/core/plugins';
6
6
  import { ModuleSchema, Plugin } from '@directive-run/core';
7
7
  import { E as Embedding, a as EmbedderFn } from './semantic-cache-F0psCRuz.js';
@@ -250,6 +250,8 @@ type MermaidDirection = "LR" | "TD" | "TB" | "RL" | "BT";
250
250
  interface MermaidNodeShapes {
251
251
  /** Shape for agent nodes. @default "square" */
252
252
  agent?: "square" | "round" | "stadium" | "hexagon";
253
+ /** Shape for task nodes. @default "hexagon" */
254
+ task?: "square" | "round" | "stadium" | "hexagon";
253
255
  /** Shape for virtual nodes (Input, Output, Merge). @default "circle" */
254
256
  virtual?: "circle" | "square" | "round" | "stadium";
255
257
  }
@@ -260,6 +262,8 @@ interface MermaidOptions {
260
262
  theme?: "default" | "dark" | "forest" | "neutral";
261
263
  /** Node shape overrides. */
262
264
  shapes?: MermaidNodeShapes;
265
+ /** Set of task IDs — used to render task nodes with distinct shapes. */
266
+ taskIds?: ReadonlySet<string>;
263
267
  }
264
268
  /**
265
269
  * Convert an execution pattern to a Mermaid diagram string.
@@ -270,7 +274,7 @@ interface MermaidOptions {
270
274
  *
271
275
  * @example
272
276
  * ```typescript
273
- * const p = dag({ fetch: { agent: "fetcher" }, report: { agent: "reporter", deps: ["fetch"] } });
277
+ * const p = dag({ fetch: { handler: "fetcher" }, report: { handler: "reporter", deps: ["fetch"] } });
274
278
  * console.log(patternToMermaid(p, { direction: "TD" }));
275
279
  * // graph TD
276
280
  * // fetch[fetcher]
@@ -808,7 +812,7 @@ declare function detectPII(text: string, options?: {
808
812
  * ```
809
813
  */
810
814
 
811
- /** Audit event types - 17 total covering all system operations */
815
+ /** Audit event types - 22 total covering all system operations */
812
816
  type AuditEventType = "agent.run.start" | "agent.run.complete" | "agent.run.error" | "tool.call.start" | "tool.call.complete" | "tool.call.error" | "approval.requested" | "approval.granted" | "approval.denied" | "requirement.created" | "requirement.met" | "resolver.start" | "resolver.complete" | "resolver.error" | "fact.set" | "fact.batch" | "error.occurred" | "error.recovery" | "checkpoint.save" | "checkpoint.restore" | "checkpoint.fork" | "checkpoint.replay";
813
817
  /** Single audit entry with hash chain linking */
814
818
  interface AuditEntry {
@@ -2575,6 +2579,9 @@ type DevToolsServerMessage = {
2575
2579
  };
2576
2580
  /** Messages sent FROM clients TO the server */
2577
2581
  type DevToolsClientMessage = {
2582
+ type: "authenticate";
2583
+ token: string;
2584
+ } | {
2578
2585
  type: "request_snapshot";
2579
2586
  } | {
2580
2587
  type: "request_health";
@@ -2661,6 +2668,8 @@ interface DevToolsServerConfig {
2661
2668
  healthPushIntervalMs?: number;
2662
2669
  /** Maximum connected clients. Default: 50 */
2663
2670
  maxClients?: number;
2671
+ /** Token authentication callback. When set, new connections must send an `authenticate` message before receiving data. */
2672
+ authenticate?: (token: string) => boolean | Promise<boolean>;
2664
2673
  }
2665
2674
  /** DevTools server instance */
2666
2675
  interface DevToolsServer {
@@ -2710,6 +2719,8 @@ interface ConnectDevToolsOptions {
2710
2719
  healthPushIntervalMs?: number;
2711
2720
  /** Event batching size. Default: 1 (no batching) */
2712
2721
  batchSize?: number;
2722
+ /** Token authentication callback. When set, clients must authenticate before receiving data. */
2723
+ authenticate?: (token: string) => boolean | Promise<boolean>;
2713
2724
  }
2714
2725
  /** Minimal orchestrator interface for DevTools connection */
2715
2726
  interface DevToolsCompatibleOrchestrator {