@directive-run/ai 1.13.0 → 1.14.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/anthropic.d.cts +1 -1
- package/dist/anthropic.d.ts +1 -1
- package/dist/{chunk-XV2QSBBE.cjs → chunk-2TD4ZSGZ.cjs} +7 -7
- package/dist/{chunk-XV2QSBBE.cjs.map → chunk-2TD4ZSGZ.cjs.map} +1 -1
- package/dist/chunk-5JQ2A3JK.js +2 -0
- package/dist/chunk-5JQ2A3JK.js.map +1 -0
- package/dist/chunk-A22KLB23.cjs +67 -0
- package/dist/chunk-A22KLB23.cjs.map +1 -0
- package/dist/chunk-A5K77UDX.cjs +4 -0
- package/dist/chunk-A5K77UDX.cjs.map +1 -0
- package/dist/chunk-DN5NAJM6.js +6 -0
- package/dist/chunk-DN5NAJM6.js.map +1 -0
- package/dist/chunk-FABDFT74.cjs +6 -0
- package/dist/chunk-FABDFT74.cjs.map +1 -0
- package/dist/chunk-FBT73WFY.js +2 -0
- package/dist/chunk-FBT73WFY.js.map +1 -0
- package/dist/chunk-FFRWQNK7.cjs +7 -0
- package/dist/chunk-FFRWQNK7.cjs.map +1 -0
- package/dist/chunk-IR3IHBVQ.cjs +2 -0
- package/dist/chunk-IR3IHBVQ.cjs.map +1 -0
- package/dist/chunk-IUGSMTBE.js +16 -0
- package/dist/{chunk-Q3PQLWBR.js.map → chunk-IUGSMTBE.js.map} +1 -1
- package/dist/chunk-J2Q5KKPN.js +37 -0
- package/dist/chunk-J2Q5KKPN.js.map +1 -0
- package/dist/chunk-K64WKZ22.cjs +2 -0
- package/dist/chunk-K64WKZ22.cjs.map +1 -0
- package/dist/chunk-LKY4K5TV.cjs +11 -0
- package/dist/chunk-LKY4K5TV.cjs.map +1 -0
- package/dist/chunk-LXUMJKGJ.js +67 -0
- package/dist/chunk-LXUMJKGJ.js.map +1 -0
- package/dist/chunk-NNAQ4ZH2.js +11 -0
- package/dist/chunk-NNAQ4ZH2.js.map +1 -0
- package/dist/chunk-PD772MSE.cjs +30 -0
- package/dist/chunk-PD772MSE.cjs.map +1 -0
- package/dist/chunk-POBEEJR6.js +30 -0
- package/dist/chunk-POBEEJR6.js.map +1 -0
- package/dist/chunk-QRXWLD6H.js +4 -0
- package/dist/chunk-QRXWLD6H.js.map +1 -0
- package/dist/chunk-UR4ZGO7V.js +7 -0
- package/dist/chunk-UR4ZGO7V.js.map +1 -0
- package/dist/chunk-UR5BMWEN.js +2 -0
- package/dist/chunk-UR5BMWEN.js.map +1 -0
- package/dist/chunk-WOFIBIPW.cjs +2 -0
- package/dist/chunk-WOFIBIPW.cjs.map +1 -0
- package/dist/chunk-XN5LUOVS.cjs +37 -0
- package/dist/chunk-XN5LUOVS.cjs.map +1 -0
- package/dist/debug-timeline-DpnRMnLU.d.cts +87 -0
- package/dist/debug-timeline-L13P-U2I.d.ts +87 -0
- package/dist/devtools.cjs +2 -0
- package/dist/devtools.cjs.map +1 -0
- package/dist/devtools.d.cts +354 -0
- package/dist/devtools.d.ts +354 -0
- package/dist/devtools.js +2 -0
- package/dist/devtools.js.map +1 -0
- package/dist/evals.cjs +2 -0
- package/dist/evals.cjs.map +1 -0
- package/dist/evals.d.cts +361 -0
- package/dist/evals.d.ts +361 -0
- package/dist/evals.js +2 -0
- package/dist/evals.js.map +1 -0
- package/dist/gemini.d.cts +1 -1
- package/dist/gemini.d.ts +1 -1
- package/dist/guardrails.cjs +2 -0
- package/dist/guardrails.cjs.map +1 -0
- package/dist/guardrails.d.cts +618 -0
- package/dist/guardrails.d.ts +618 -0
- package/dist/guardrails.js +2 -0
- package/dist/guardrails.js.map +1 -0
- package/dist/health-monitor-C6xoXrQz.d.cts +55 -0
- package/dist/health-monitor-qL9RNMH3.d.ts +55 -0
- package/dist/index.cjs +21 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1197 -4735
- package/dist/index.d.ts +1197 -4735
- package/dist/index.js +21 -99
- package/dist/index.js.map +1 -1
- package/dist/mcp.cjs +2 -0
- package/dist/mcp.cjs.map +1 -0
- package/dist/mcp.d.cts +450 -0
- package/dist/mcp.d.ts +450 -0
- package/dist/mcp.js +2 -0
- package/dist/mcp.js.map +1 -0
- package/dist/multi-agent-orchestrator-QWWQKKGX.js +2 -0
- package/dist/{multi-agent-orchestrator-4PXNYRHB.js.map → multi-agent-orchestrator-QWWQKKGX.js.map} +1 -1
- package/dist/multi-agent-orchestrator-Y5U4JCFO.cjs +2 -0
- package/dist/{multi-agent-orchestrator-KFGTEGE5.cjs.map → multi-agent-orchestrator-Y5U4JCFO.cjs.map} +1 -1
- package/dist/multi-agent.cjs +2 -0
- package/dist/multi-agent.cjs.map +1 -0
- package/dist/multi-agent.d.cts +1429 -0
- package/dist/multi-agent.d.ts +1429 -0
- package/dist/multi-agent.js +2 -0
- package/dist/multi-agent.js.map +1 -0
- package/dist/ollama.d.cts +1 -1
- package/dist/ollama.d.ts +1 -1
- package/dist/openai.d.cts +2 -2
- package/dist/openai.d.ts +2 -2
- package/dist/{orchestrator-types-CTfIKk0W.d.ts → orchestrator-types-DGBhL6mc.d.ts} +5 -138
- package/dist/{orchestrator-types-Bh8r3_Sq.d.cts → orchestrator-types-DeIMRLR7.d.cts} +5 -138
- package/dist/predicate.cjs +2 -0
- package/dist/predicate.cjs.map +1 -0
- package/dist/predicate.d.cts +371 -0
- package/dist/predicate.d.ts +371 -0
- package/dist/predicate.js +2 -0
- package/dist/predicate.js.map +1 -0
- package/dist/{semantic-cache-nBpQqILc.d.cts → semantic-cache-DM7ev7NQ.d.cts} +1 -1
- package/dist/{semantic-cache-nBpQqILc.d.ts → semantic-cache-DM7ev7NQ.d.ts} +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +4 -2
- package/dist/testing.d.ts +4 -2
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/{types-CRmwFnVk.d.cts → types-DJ09LjZX.d.cts} +1 -1
- package/dist/{types-CRmwFnVk.d.ts → types-DJ09LjZX.d.ts} +1 -1
- package/package.json +32 -2
- package/dist/chunk-Q3PQLWBR.js +0 -16
- package/dist/chunk-RW4R3O5P.js +0 -72
- package/dist/chunk-RW4R3O5P.js.map +0 -1
- package/dist/chunk-X3VQ5F7D.cjs +0 -72
- package/dist/chunk-X3VQ5F7D.cjs.map +0 -1
- package/dist/multi-agent-orchestrator-4PXNYRHB.js +0 -2
- package/dist/multi-agent-orchestrator-KFGTEGE5.cjs +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{c as createAgentNetwork,e as createDelegator,b as createMessageBus,f as createPubSub,d as createResponder,j as explainGoal,g as getDependencyGraph,a as patternToMermaid,i as planGoal,h as validateGoal}from'./chunk-DN5NAJM6.js';export{y as InMemoryCheckpointStore,s as MAX_BREAKPOINT_HISTORY,K as ReflectionExhaustedError,N as Semaphore,ia as aggregateTokens,_ as allReadyStrategy,la as capabilityRoute,ha as collectOutputs,ja as composePatterns,fa as concatResults,aa as costEfficientStrategy,t as createBreakpointId,w as createCheckpointId,v as createInitialBreakpointState,ra as createMultiAgentOrchestrator,W as dag,na as debate,pa as derivedConstraint,Q as diffCheckpoints,ka as findAgentsByCapability,R as forkFromCheckpoint,P as getCheckpointProgress,O as getPatternStep,Z as goal,$ as highestImpactStrategy,u as matchBreakpoint,T as parallel,ca as patternFromJSON,ba as patternToJSON,ga as pickBestResult,Y as race,X as reflect,ea as runAgentRequirement,oa as runDebate,da as selectAgent,U as sequential,ma as spawnOnCondition,qa as spawnPool,V as supervisor,x as validateCheckpoint,L as withReflection}from'./chunk-LXUMJKGJ.js';import'./chunk-UR5BMWEN.js';import'./chunk-FBT73WFY.js';import'./chunk-UR4ZGO7V.js';//# sourceMappingURL=multi-agent.js.map
|
|
2
|
+
//# sourceMappingURL=multi-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"multi-agent.js"}
|
package/dist/ollama.d.cts
CHANGED
package/dist/ollama.d.ts
CHANGED
package/dist/openai.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { E as EmbedderFn } from './semantic-cache-DM7ev7NQ.cjs';
|
|
2
|
+
import { o as AdapterHooks, c as AgentRunner, p as StreamingCallbackRunner } from './types-DJ09LjZX.cjs';
|
|
3
3
|
import '@directive-run/core';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/openai.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { E as EmbedderFn } from './semantic-cache-DM7ev7NQ.js';
|
|
2
|
+
import { o as AdapterHooks, c as AgentRunner, p as StreamingCallbackRunner } from './types-DJ09LjZX.js';
|
|
3
3
|
import '@directive-run/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { M as Message$1,
|
|
2
|
-
import {
|
|
1
|
+
import { M as Message$1, q as RunResult, b as AgentLike, m as GuardrailFn, O as OutputGuardrailData, p as StreamingCallbackRunner, c as AgentRunner, r as OrchestratorState, N as NamedGuardrail, I as InputGuardrailData, C as Checkpoint, B as BreakpointModifications, d as BreakpointRequest, s as OrchestratorConstraint, t as OrchestratorResolver, u as GuardrailsConfig, A as ApprovalRequest, v as OrchestratorDebugConfig, w as AgentRetryConfig, x as OrchestratorLifecycleHooks, y as SelfHealingConfig, h as CheckpointStore, z as BreakpointConfig, R as RunOptions, T as ToolCallGuardrailData, P as PatternCheckpointConfig, k as DagPattern, E as GoalPattern, F as GoalNode, J as AgentSelectionStrategy, K as RelaxationTier, L as GoalResult, Q as GoalCheckpointState, U as SequentialCheckpointState, V as SupervisorCheckpointState, W as ReflectCheckpointState, X as DebateCheckpointState, Y as DagCheckpointState, S as Scratchpad, Z as MultiAgentLifecycleHooks, _ as MultiAgentSelfHealingConfig, $ as MultiAgentBreakpointType, a0 as CrossAgentDerivationFn } from './types-DJ09LjZX.js';
|
|
2
|
+
import { System, Requirement, Plugin } from '@directive-run/core';
|
|
3
3
|
import { CircuitBreaker } from '@directive-run/core/plugins';
|
|
4
|
+
import { D as DebugTimeline } from './debug-timeline-L13P-U2I.js';
|
|
5
|
+
import { H as HealthMonitor } from './health-monitor-qL9RNMH3.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Agent Memory System
|
|
@@ -600,89 +602,6 @@ interface MergedTaggedStreamResult {
|
|
|
600
602
|
*/
|
|
601
603
|
declare function mergeTaggedStreams(sources: TaggedSource[]): MergedTaggedStreamResult;
|
|
602
604
|
|
|
603
|
-
/**
|
|
604
|
-
* Debug Timeline — AI-specific event log with snapshot correlation.
|
|
605
|
-
*
|
|
606
|
-
* Records agent lifecycle events (start, complete, error, guardrail checks,
|
|
607
|
-
* approvals, handoffs, patterns) and correlates them with core time-travel
|
|
608
|
-
* snapshots for visual timeline UIs and fork-and-replay debugging.
|
|
609
|
-
*
|
|
610
|
-
* Zero-cost when debug=false — the timeline is simply `null`.
|
|
611
|
-
*
|
|
612
|
-
* @module
|
|
613
|
-
*/
|
|
614
|
-
|
|
615
|
-
/** Callback fired when a new event is recorded */
|
|
616
|
-
type DebugTimelineListener = (event: DebugEvent) => void;
|
|
617
|
-
/** Debug timeline instance */
|
|
618
|
-
interface DebugTimeline {
|
|
619
|
-
/** Record a new event (id is auto-assigned) */
|
|
620
|
-
record(event: Omit<DebugEvent, "id"> & Record<string, unknown>): DebugEvent;
|
|
621
|
-
/** Get all events in order */
|
|
622
|
-
getEvents(): DebugEvent[];
|
|
623
|
-
/** Get events for a specific agent */
|
|
624
|
-
getEventsForAgent(agentId: string): DebugEvent[];
|
|
625
|
-
/** Get events by type with type narrowing */
|
|
626
|
-
getEventsByType<T extends DebugEventType>(type: T): Extract<DebugEvent, {
|
|
627
|
-
type: T;
|
|
628
|
-
}>[];
|
|
629
|
-
/** Get events at a specific snapshot */
|
|
630
|
-
getEventsAtSnapshot(snapshotId: number): DebugEvent[];
|
|
631
|
-
/** Get events in a time range */
|
|
632
|
-
getEventsInRange(startMs: number, endMs: number): DebugEvent[];
|
|
633
|
-
/** Fork from a snapshot — truncates events after it and calls goTo */
|
|
634
|
-
forkFrom(snapshotId: number): void;
|
|
635
|
-
/** Export timeline as JSON */
|
|
636
|
-
export(): string;
|
|
637
|
-
/** Import timeline from JSON */
|
|
638
|
-
import(json: string): void;
|
|
639
|
-
/** Clear all events */
|
|
640
|
-
clear(): void;
|
|
641
|
-
/** Subscribe to new events. Returns unsubscribe function. */
|
|
642
|
-
subscribe(listener: DebugTimelineListener): () => void;
|
|
643
|
-
/** Current number of events */
|
|
644
|
-
readonly length: number;
|
|
645
|
-
}
|
|
646
|
-
/** Options for creating a debug timeline */
|
|
647
|
-
interface DebugTimelineOptions {
|
|
648
|
-
/** Maximum events before eviction. @default 2000 */
|
|
649
|
-
maxEvents?: number;
|
|
650
|
-
/** Callback to get current snapshot ID from the system */
|
|
651
|
-
getSnapshotId?: () => number | null;
|
|
652
|
-
/** Callback to navigate to a snapshot (for forkFrom) */
|
|
653
|
-
goToSnapshot?: (snapshotId: number) => void;
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* Create a debug timeline for recording and correlating AI events.
|
|
657
|
-
*
|
|
658
|
-
* @example
|
|
659
|
-
* ```typescript
|
|
660
|
-
* const timeline = createDebugTimeline({ maxEvents: 1000 });
|
|
661
|
-
*
|
|
662
|
-
* timeline.record({
|
|
663
|
-
* type: "agent_start",
|
|
664
|
-
* timestamp: Date.now(),
|
|
665
|
-
* agentId: "researcher",
|
|
666
|
-
* snapshotId: null,
|
|
667
|
-
* inputLength: 42,
|
|
668
|
-
* });
|
|
669
|
-
*
|
|
670
|
-
* const agentEvents = timeline.getEventsForAgent("researcher");
|
|
671
|
-
* ```
|
|
672
|
-
*/
|
|
673
|
-
declare function createDebugTimeline(options?: DebugTimelineOptions): DebugTimeline;
|
|
674
|
-
/**
|
|
675
|
-
* Create a Directive plugin that bridges core constraint/resolver events
|
|
676
|
-
* to the debug timeline.
|
|
677
|
-
*
|
|
678
|
-
* @example
|
|
679
|
-
* ```typescript
|
|
680
|
-
* const timeline = createDebugTimeline();
|
|
681
|
-
* const plugin = createDebugTimelinePlugin(timeline, () => system.history?.currentIndex ?? null);
|
|
682
|
-
* ```
|
|
683
|
-
*/
|
|
684
|
-
declare function createDebugTimelinePlugin(timeline: DebugTimeline, getSnapshotId: () => number | null): Plugin;
|
|
685
|
-
|
|
686
605
|
/**
|
|
687
606
|
* P6: Structured Outputs — Schema validation with auto-retry for LLM responses.
|
|
688
607
|
*
|
|
@@ -1063,58 +982,6 @@ interface AgentOrchestrator<F extends Record<string, unknown>> {
|
|
|
1063
982
|
*/
|
|
1064
983
|
declare function createAgentOrchestrator<F extends Record<string, unknown> = Record<string, never>>(options: OrchestratorOptions<F>): AgentOrchestrator<F>;
|
|
1065
984
|
|
|
1066
|
-
/**
|
|
1067
|
-
* Health Monitor — tracks per-agent health metrics for self-healing networks.
|
|
1068
|
-
*
|
|
1069
|
-
* Pure computation module with zero Directive dependency.
|
|
1070
|
-
* Maintains a rolling window of success/failure events and computes a health
|
|
1071
|
-
* score from 0-100 based on configurable weights.
|
|
1072
|
-
*
|
|
1073
|
-
* @module
|
|
1074
|
-
*/
|
|
1075
|
-
|
|
1076
|
-
/** Circuit state values */
|
|
1077
|
-
type HealthCircuitState = "CLOSED" | "OPEN" | "HALF_OPEN";
|
|
1078
|
-
/** Per-agent health metrics */
|
|
1079
|
-
interface AgentHealthMetrics {
|
|
1080
|
-
agentId: string;
|
|
1081
|
-
circuitState: HealthCircuitState;
|
|
1082
|
-
successRate: number;
|
|
1083
|
-
avgLatencyMs: number;
|
|
1084
|
-
recentFailures: number;
|
|
1085
|
-
recentSuccesses: number;
|
|
1086
|
-
healthScore: number;
|
|
1087
|
-
/** Last N error messages (most recent last) */
|
|
1088
|
-
lastErrors: string[];
|
|
1089
|
-
}
|
|
1090
|
-
/** Health monitor instance */
|
|
1091
|
-
interface HealthMonitor {
|
|
1092
|
-
recordSuccess(agentId: string, latencyMs: number): void;
|
|
1093
|
-
recordFailure(agentId: string, latencyMs: number, error?: Error): void;
|
|
1094
|
-
getMetrics(agentId: string): AgentHealthMetrics;
|
|
1095
|
-
getAllMetrics(): Record<string, AgentHealthMetrics>;
|
|
1096
|
-
/** Returns a 0-100 health score. Returns 50 (neutral) when no data is available for the agent. */
|
|
1097
|
-
getHealthScore(agentId: string): number;
|
|
1098
|
-
updateCircuitState(agentId: string, state: HealthCircuitState): void;
|
|
1099
|
-
/** Reset all metrics. Useful for testing. */
|
|
1100
|
-
reset(): void;
|
|
1101
|
-
}
|
|
1102
|
-
/**
|
|
1103
|
-
* Create a health monitor that tracks per-agent metrics.
|
|
1104
|
-
*
|
|
1105
|
-
* @example
|
|
1106
|
-
* ```typescript
|
|
1107
|
-
* const monitor = createHealthMonitor({ windowMs: 30000 });
|
|
1108
|
-
*
|
|
1109
|
-
* monitor.recordSuccess("agent-a", 120);
|
|
1110
|
-
* monitor.recordFailure("agent-a", 5000, new Error("timeout"));
|
|
1111
|
-
*
|
|
1112
|
-
* const score = monitor.getHealthScore("agent-a");
|
|
1113
|
-
* console.log(score); // 0-100
|
|
1114
|
-
* ```
|
|
1115
|
-
*/
|
|
1116
|
-
declare function createHealthMonitor(config?: HealthMonitorConfig): HealthMonitor;
|
|
1117
|
-
|
|
1118
985
|
/**
|
|
1119
986
|
* Agent Reflection / Self-Improvement
|
|
1120
987
|
*
|
|
@@ -1781,4 +1648,4 @@ interface MultiAgentOrchestrator {
|
|
|
1781
1648
|
destroy(): void;
|
|
1782
1649
|
}
|
|
1783
1650
|
|
|
1784
|
-
export { type
|
|
1651
|
+
export { type StreamingGuardrailResult as $, type AgentOrchestrator as A, type BackpressureStrategy as B, type RaceSuccessEntry as C, type DebatePattern as D, type ErrorChunk as E, type ReflectIterationRecord as F, type GuardrailTriggeredChunk as G, type HandoffRequest as H, type ReflectPattern as I, type ReflectionConfig as J, type ReflectionContext as K, type ReflectionEvaluation as L, type MultiAgentOrchestrator as M, ReflectionExhaustedError as N, type OrchestratorOptions as O, type ParallelPattern as P, type RunAgentRequirement as Q, type ReflectionEvaluator as R, type RunCallOptions as S, type TaskRegistration as T, type SafeParseResult as U, type SafeParseable as V, type SequentialPattern as W, type StreamChunk as X, type StreamRunOptions as Y, type StreamRunner as Z, type StreamingGuardrail as _, type MultiAgentOrchestratorOptions as a, type StreamingRunResult as a0, type StructuredOutputConfig as a1, StructuredOutputError as a2, type SupervisorPattern as a3, type TaskContext as a4, type TokenChunk as a5, type ToolEndChunk as a6, type ToolStartChunk as a7, adaptOutputGuardrail as a8, collectTokens as a9, combineStreamingGuardrails as aa, createAgentMemory as ab, createAgentOrchestrator as ac, createHybridStrategy as ad, createKeyPointsSummarizer as ae, createLLMSummarizer as af, createLengthStreamingGuardrail as ag, createPatternStreamingGuardrail as ah, createSlidingWindowStrategy as ai, createStreamingRunner as aj, createTokenBasedStrategy as ak, createToxicityStreamingGuardrail as al, createTruncationSummarizer as am, extractJsonFromOutput as an, filterStream as ao, mapStream as ap, mergeTaggedStreams as aq, tapStream as ar, withReflection as as, withStructuredOutput as at, type MultiplexedStreamChunk as b, type AgentMemory as c, type AgentMemoryConfig as d, type AgentRegistration as e, type AgentRegistry as f, type DebateResult as g, type DoneChunk as h, type ExecutionPattern as i, type HandoffResult as j, type MemoryManageResult as k, type MemoryState as l, type MemoryStrategy as m, type MemoryStrategyConfig as n, type MemoryStrategyResult as o, type MergedTaggedStreamResult as p, type MessageChunk as q, type MessageSummarizer as r, type MultiAgentRunCallOptions as s, type MultiAgentState as t, type MultiplexedStreamResult as u, type OrchestratorStreamChunk as v, type OrchestratorStreamResult as w, type ProgressChunk as x, type RacePattern as y, type RaceResult as z };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { M as Message$1,
|
|
2
|
-
import {
|
|
1
|
+
import { M as Message$1, q as RunResult, b as AgentLike, m as GuardrailFn, O as OutputGuardrailData, p as StreamingCallbackRunner, c as AgentRunner, r as OrchestratorState, N as NamedGuardrail, I as InputGuardrailData, C as Checkpoint, B as BreakpointModifications, d as BreakpointRequest, s as OrchestratorConstraint, t as OrchestratorResolver, u as GuardrailsConfig, A as ApprovalRequest, v as OrchestratorDebugConfig, w as AgentRetryConfig, x as OrchestratorLifecycleHooks, y as SelfHealingConfig, h as CheckpointStore, z as BreakpointConfig, R as RunOptions, T as ToolCallGuardrailData, P as PatternCheckpointConfig, k as DagPattern, E as GoalPattern, F as GoalNode, J as AgentSelectionStrategy, K as RelaxationTier, L as GoalResult, Q as GoalCheckpointState, U as SequentialCheckpointState, V as SupervisorCheckpointState, W as ReflectCheckpointState, X as DebateCheckpointState, Y as DagCheckpointState, S as Scratchpad, Z as MultiAgentLifecycleHooks, _ as MultiAgentSelfHealingConfig, $ as MultiAgentBreakpointType, a0 as CrossAgentDerivationFn } from './types-DJ09LjZX.cjs';
|
|
2
|
+
import { System, Requirement, Plugin } from '@directive-run/core';
|
|
3
3
|
import { CircuitBreaker } from '@directive-run/core/plugins';
|
|
4
|
+
import { D as DebugTimeline } from './debug-timeline-DpnRMnLU.cjs';
|
|
5
|
+
import { H as HealthMonitor } from './health-monitor-C6xoXrQz.cjs';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Agent Memory System
|
|
@@ -600,89 +602,6 @@ interface MergedTaggedStreamResult {
|
|
|
600
602
|
*/
|
|
601
603
|
declare function mergeTaggedStreams(sources: TaggedSource[]): MergedTaggedStreamResult;
|
|
602
604
|
|
|
603
|
-
/**
|
|
604
|
-
* Debug Timeline — AI-specific event log with snapshot correlation.
|
|
605
|
-
*
|
|
606
|
-
* Records agent lifecycle events (start, complete, error, guardrail checks,
|
|
607
|
-
* approvals, handoffs, patterns) and correlates them with core time-travel
|
|
608
|
-
* snapshots for visual timeline UIs and fork-and-replay debugging.
|
|
609
|
-
*
|
|
610
|
-
* Zero-cost when debug=false — the timeline is simply `null`.
|
|
611
|
-
*
|
|
612
|
-
* @module
|
|
613
|
-
*/
|
|
614
|
-
|
|
615
|
-
/** Callback fired when a new event is recorded */
|
|
616
|
-
type DebugTimelineListener = (event: DebugEvent) => void;
|
|
617
|
-
/** Debug timeline instance */
|
|
618
|
-
interface DebugTimeline {
|
|
619
|
-
/** Record a new event (id is auto-assigned) */
|
|
620
|
-
record(event: Omit<DebugEvent, "id"> & Record<string, unknown>): DebugEvent;
|
|
621
|
-
/** Get all events in order */
|
|
622
|
-
getEvents(): DebugEvent[];
|
|
623
|
-
/** Get events for a specific agent */
|
|
624
|
-
getEventsForAgent(agentId: string): DebugEvent[];
|
|
625
|
-
/** Get events by type with type narrowing */
|
|
626
|
-
getEventsByType<T extends DebugEventType>(type: T): Extract<DebugEvent, {
|
|
627
|
-
type: T;
|
|
628
|
-
}>[];
|
|
629
|
-
/** Get events at a specific snapshot */
|
|
630
|
-
getEventsAtSnapshot(snapshotId: number): DebugEvent[];
|
|
631
|
-
/** Get events in a time range */
|
|
632
|
-
getEventsInRange(startMs: number, endMs: number): DebugEvent[];
|
|
633
|
-
/** Fork from a snapshot — truncates events after it and calls goTo */
|
|
634
|
-
forkFrom(snapshotId: number): void;
|
|
635
|
-
/** Export timeline as JSON */
|
|
636
|
-
export(): string;
|
|
637
|
-
/** Import timeline from JSON */
|
|
638
|
-
import(json: string): void;
|
|
639
|
-
/** Clear all events */
|
|
640
|
-
clear(): void;
|
|
641
|
-
/** Subscribe to new events. Returns unsubscribe function. */
|
|
642
|
-
subscribe(listener: DebugTimelineListener): () => void;
|
|
643
|
-
/** Current number of events */
|
|
644
|
-
readonly length: number;
|
|
645
|
-
}
|
|
646
|
-
/** Options for creating a debug timeline */
|
|
647
|
-
interface DebugTimelineOptions {
|
|
648
|
-
/** Maximum events before eviction. @default 2000 */
|
|
649
|
-
maxEvents?: number;
|
|
650
|
-
/** Callback to get current snapshot ID from the system */
|
|
651
|
-
getSnapshotId?: () => number | null;
|
|
652
|
-
/** Callback to navigate to a snapshot (for forkFrom) */
|
|
653
|
-
goToSnapshot?: (snapshotId: number) => void;
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* Create a debug timeline for recording and correlating AI events.
|
|
657
|
-
*
|
|
658
|
-
* @example
|
|
659
|
-
* ```typescript
|
|
660
|
-
* const timeline = createDebugTimeline({ maxEvents: 1000 });
|
|
661
|
-
*
|
|
662
|
-
* timeline.record({
|
|
663
|
-
* type: "agent_start",
|
|
664
|
-
* timestamp: Date.now(),
|
|
665
|
-
* agentId: "researcher",
|
|
666
|
-
* snapshotId: null,
|
|
667
|
-
* inputLength: 42,
|
|
668
|
-
* });
|
|
669
|
-
*
|
|
670
|
-
* const agentEvents = timeline.getEventsForAgent("researcher");
|
|
671
|
-
* ```
|
|
672
|
-
*/
|
|
673
|
-
declare function createDebugTimeline(options?: DebugTimelineOptions): DebugTimeline;
|
|
674
|
-
/**
|
|
675
|
-
* Create a Directive plugin that bridges core constraint/resolver events
|
|
676
|
-
* to the debug timeline.
|
|
677
|
-
*
|
|
678
|
-
* @example
|
|
679
|
-
* ```typescript
|
|
680
|
-
* const timeline = createDebugTimeline();
|
|
681
|
-
* const plugin = createDebugTimelinePlugin(timeline, () => system.history?.currentIndex ?? null);
|
|
682
|
-
* ```
|
|
683
|
-
*/
|
|
684
|
-
declare function createDebugTimelinePlugin(timeline: DebugTimeline, getSnapshotId: () => number | null): Plugin;
|
|
685
|
-
|
|
686
605
|
/**
|
|
687
606
|
* P6: Structured Outputs — Schema validation with auto-retry for LLM responses.
|
|
688
607
|
*
|
|
@@ -1063,58 +982,6 @@ interface AgentOrchestrator<F extends Record<string, unknown>> {
|
|
|
1063
982
|
*/
|
|
1064
983
|
declare function createAgentOrchestrator<F extends Record<string, unknown> = Record<string, never>>(options: OrchestratorOptions<F>): AgentOrchestrator<F>;
|
|
1065
984
|
|
|
1066
|
-
/**
|
|
1067
|
-
* Health Monitor — tracks per-agent health metrics for self-healing networks.
|
|
1068
|
-
*
|
|
1069
|
-
* Pure computation module with zero Directive dependency.
|
|
1070
|
-
* Maintains a rolling window of success/failure events and computes a health
|
|
1071
|
-
* score from 0-100 based on configurable weights.
|
|
1072
|
-
*
|
|
1073
|
-
* @module
|
|
1074
|
-
*/
|
|
1075
|
-
|
|
1076
|
-
/** Circuit state values */
|
|
1077
|
-
type HealthCircuitState = "CLOSED" | "OPEN" | "HALF_OPEN";
|
|
1078
|
-
/** Per-agent health metrics */
|
|
1079
|
-
interface AgentHealthMetrics {
|
|
1080
|
-
agentId: string;
|
|
1081
|
-
circuitState: HealthCircuitState;
|
|
1082
|
-
successRate: number;
|
|
1083
|
-
avgLatencyMs: number;
|
|
1084
|
-
recentFailures: number;
|
|
1085
|
-
recentSuccesses: number;
|
|
1086
|
-
healthScore: number;
|
|
1087
|
-
/** Last N error messages (most recent last) */
|
|
1088
|
-
lastErrors: string[];
|
|
1089
|
-
}
|
|
1090
|
-
/** Health monitor instance */
|
|
1091
|
-
interface HealthMonitor {
|
|
1092
|
-
recordSuccess(agentId: string, latencyMs: number): void;
|
|
1093
|
-
recordFailure(agentId: string, latencyMs: number, error?: Error): void;
|
|
1094
|
-
getMetrics(agentId: string): AgentHealthMetrics;
|
|
1095
|
-
getAllMetrics(): Record<string, AgentHealthMetrics>;
|
|
1096
|
-
/** Returns a 0-100 health score. Returns 50 (neutral) when no data is available for the agent. */
|
|
1097
|
-
getHealthScore(agentId: string): number;
|
|
1098
|
-
updateCircuitState(agentId: string, state: HealthCircuitState): void;
|
|
1099
|
-
/** Reset all metrics. Useful for testing. */
|
|
1100
|
-
reset(): void;
|
|
1101
|
-
}
|
|
1102
|
-
/**
|
|
1103
|
-
* Create a health monitor that tracks per-agent metrics.
|
|
1104
|
-
*
|
|
1105
|
-
* @example
|
|
1106
|
-
* ```typescript
|
|
1107
|
-
* const monitor = createHealthMonitor({ windowMs: 30000 });
|
|
1108
|
-
*
|
|
1109
|
-
* monitor.recordSuccess("agent-a", 120);
|
|
1110
|
-
* monitor.recordFailure("agent-a", 5000, new Error("timeout"));
|
|
1111
|
-
*
|
|
1112
|
-
* const score = monitor.getHealthScore("agent-a");
|
|
1113
|
-
* console.log(score); // 0-100
|
|
1114
|
-
* ```
|
|
1115
|
-
*/
|
|
1116
|
-
declare function createHealthMonitor(config?: HealthMonitorConfig): HealthMonitor;
|
|
1117
|
-
|
|
1118
985
|
/**
|
|
1119
986
|
* Agent Reflection / Self-Improvement
|
|
1120
987
|
*
|
|
@@ -1781,4 +1648,4 @@ interface MultiAgentOrchestrator {
|
|
|
1781
1648
|
destroy(): void;
|
|
1782
1649
|
}
|
|
1783
1650
|
|
|
1784
|
-
export { type
|
|
1651
|
+
export { type StreamingGuardrailResult as $, type AgentOrchestrator as A, type BackpressureStrategy as B, type RaceSuccessEntry as C, type DebatePattern as D, type ErrorChunk as E, type ReflectIterationRecord as F, type GuardrailTriggeredChunk as G, type HandoffRequest as H, type ReflectPattern as I, type ReflectionConfig as J, type ReflectionContext as K, type ReflectionEvaluation as L, type MultiAgentOrchestrator as M, ReflectionExhaustedError as N, type OrchestratorOptions as O, type ParallelPattern as P, type RunAgentRequirement as Q, type ReflectionEvaluator as R, type RunCallOptions as S, type TaskRegistration as T, type SafeParseResult as U, type SafeParseable as V, type SequentialPattern as W, type StreamChunk as X, type StreamRunOptions as Y, type StreamRunner as Z, type StreamingGuardrail as _, type MultiAgentOrchestratorOptions as a, type StreamingRunResult as a0, type StructuredOutputConfig as a1, StructuredOutputError as a2, type SupervisorPattern as a3, type TaskContext as a4, type TokenChunk as a5, type ToolEndChunk as a6, type ToolStartChunk as a7, adaptOutputGuardrail as a8, collectTokens as a9, combineStreamingGuardrails as aa, createAgentMemory as ab, createAgentOrchestrator as ac, createHybridStrategy as ad, createKeyPointsSummarizer as ae, createLLMSummarizer as af, createLengthStreamingGuardrail as ag, createPatternStreamingGuardrail as ah, createSlidingWindowStrategy as ai, createStreamingRunner as aj, createTokenBasedStrategy as ak, createToxicityStreamingGuardrail as al, createTruncationSummarizer as am, extractJsonFromOutput as an, filterStream as ao, mapStream as ap, mergeTaggedStreams as aq, tapStream as ar, withReflection as as, withStructuredOutput as at, type MultiplexedStreamChunk as b, type AgentMemory as c, type AgentMemoryConfig as d, type AgentRegistration as e, type AgentRegistry as f, type DebateResult as g, type DoneChunk as h, type ExecutionPattern as i, type HandoffResult as j, type MemoryManageResult as k, type MemoryState as l, type MemoryStrategy as m, type MemoryStrategyConfig as n, type MemoryStrategyResult as o, type MergedTaggedStreamResult as p, type MessageChunk as q, type MessageSummarizer as r, type MultiAgentRunCallOptions as s, type MultiAgentState as t, type MultiplexedStreamResult as u, type OrchestratorStreamChunk as v, type OrchestratorStreamResult as w, type ProgressChunk as x, type RacePattern as y, type RaceResult as z };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkPD772MSE_cjs=require('./chunk-PD772MSE.cjs');require('./chunk-FFRWQNK7.cjs');Object.defineProperty(exports,"PredicateFromIntentError",{enumerable:true,get:function(){return chunkPD772MSE_cjs.a}});Object.defineProperty(exports,"predicateFromIntent",{enumerable:true,get:function(){return chunkPD772MSE_cjs.b}});Object.defineProperty(exports,"predicateFromIntentRaw",{enumerable:true,get:function(){return chunkPD772MSE_cjs.c}});Object.defineProperty(exports,"predicateFromIntentWithProvenance",{enumerable:true,get:function(){return chunkPD772MSE_cjs.g}});Object.defineProperty(exports,"predicateToolSpec",{enumerable:true,get:function(){return chunkPD772MSE_cjs.f}});Object.defineProperty(exports,"predicateToolSpecAnthropic",{enumerable:true,get:function(){return chunkPD772MSE_cjs.e}});Object.defineProperty(exports,"predicateToolSpecOpenAI",{enumerable:true,get:function(){return chunkPD772MSE_cjs.d}});//# sourceMappingURL=predicate.cjs.map
|
|
2
|
+
//# sourceMappingURL=predicate.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"predicate.cjs"}
|