@agentforge/patterns 0.16.45 → 0.16.47

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,20 +1,11 @@
1
+ import * as _agentforge_core from '@agentforge/core';
2
+ import { ToolRegistry, Tool, ToolMetadata, LogLevel } from '@agentforge/core';
1
3
  import { z } from 'zod';
2
4
  import * as _langchain_langgraph from '@langchain/langgraph';
3
5
  import { BaseCheckpointSaver, CompiledStateGraph } from '@langchain/langgraph';
4
6
  import { BaseChatModel } from '@langchain/core/language_models/chat_models';
5
- import * as _agentforge_core from '@agentforge/core';
6
- import { ToolRegistry, Tool, ToolMetadata, LogLevel } from '@agentforge/core';
7
7
  import { RunnableConfig } from '@langchain/core/runnables';
8
8
 
9
- /**
10
- * Zod schemas for ReAct pattern state
11
- *
12
- * These schemas define the structure of messages, thoughts, actions, and observations
13
- * used in the ReAct (Reasoning and Action) pattern.
14
- *
15
- * @module langgraph/patterns/react/schemas
16
- */
17
-
18
9
  /**
19
10
  * Base message schema
20
11
  *
@@ -27,19 +18,19 @@ declare const MessageSchema: z.ZodObject<{
27
18
  content: z.ZodString;
28
19
  name: z.ZodOptional<z.ZodString>;
29
20
  tool_call_id: z.ZodOptional<z.ZodString>;
30
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
21
+ metadata: z.ZodOptional<z.ZodType<_agentforge_core.JsonObject, z.ZodTypeDef, _agentforge_core.JsonObject>>;
31
22
  }, "strip", z.ZodTypeAny, {
32
23
  role: "system" | "user" | "assistant" | "tool";
33
24
  content: string;
34
25
  name?: string | undefined;
35
26
  tool_call_id?: string | undefined;
36
- metadata?: Record<string, any> | undefined;
27
+ metadata?: _agentforge_core.JsonObject | undefined;
37
28
  }, {
38
29
  role: "system" | "user" | "assistant" | "tool";
39
30
  content: string;
40
31
  name?: string | undefined;
41
32
  tool_call_id?: string | undefined;
42
- metadata?: Record<string, any> | undefined;
33
+ metadata?: _agentforge_core.JsonObject | undefined;
43
34
  }>;
44
35
  type Message = z.infer<typeof MessageSchema>;
45
36
  /**
@@ -48,14 +39,14 @@ type Message = z.infer<typeof MessageSchema>;
48
39
  declare const ThoughtSchema: z.ZodObject<{
49
40
  content: z.ZodString;
50
41
  timestamp: z.ZodOptional<z.ZodNumber>;
51
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
42
+ metadata: z.ZodOptional<z.ZodType<_agentforge_core.JsonObject, z.ZodTypeDef, _agentforge_core.JsonObject>>;
52
43
  }, "strip", z.ZodTypeAny, {
53
44
  content: string;
54
- metadata?: Record<string, any> | undefined;
45
+ metadata?: _agentforge_core.JsonObject | undefined;
55
46
  timestamp?: number | undefined;
56
47
  }, {
57
48
  content: string;
58
- metadata?: Record<string, any> | undefined;
49
+ metadata?: _agentforge_core.JsonObject | undefined;
59
50
  timestamp?: number | undefined;
60
51
  }>;
61
52
  type Thought = z.infer<typeof ThoughtSchema>;
@@ -65,17 +56,17 @@ type Thought = z.infer<typeof ThoughtSchema>;
65
56
  declare const ToolCallSchema: z.ZodObject<{
66
57
  id: z.ZodString;
67
58
  name: z.ZodString;
68
- arguments: z.ZodRecord<z.ZodString, z.ZodAny>;
59
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
69
60
  timestamp: z.ZodOptional<z.ZodNumber>;
70
61
  }, "strip", z.ZodTypeAny, {
71
62
  name: string;
72
63
  id: string;
73
- arguments: Record<string, any>;
64
+ arguments: Record<string, unknown>;
74
65
  timestamp?: number | undefined;
75
66
  }, {
76
67
  name: string;
77
68
  id: string;
78
- arguments: Record<string, any>;
69
+ arguments: Record<string, unknown>;
79
70
  timestamp?: number | undefined;
80
71
  }>;
81
72
  type ToolCall = z.infer<typeof ToolCallSchema>;
@@ -84,20 +75,20 @@ type ToolCall = z.infer<typeof ToolCallSchema>;
84
75
  */
85
76
  declare const ToolResultSchema: z.ZodObject<{
86
77
  toolCallId: z.ZodString;
87
- result: z.ZodAny;
78
+ result: z.ZodUnknown;
88
79
  error: z.ZodOptional<z.ZodString>;
89
80
  timestamp: z.ZodOptional<z.ZodNumber>;
90
81
  isDuplicate: z.ZodOptional<z.ZodBoolean>;
91
82
  }, "strip", z.ZodTypeAny, {
92
83
  toolCallId: string;
93
84
  timestamp?: number | undefined;
94
- result?: any;
85
+ result?: unknown;
95
86
  error?: string | undefined;
96
87
  isDuplicate?: boolean | undefined;
97
88
  }, {
98
89
  toolCallId: string;
99
90
  timestamp?: number | undefined;
100
- result?: any;
91
+ result?: unknown;
101
92
  error?: string | undefined;
102
93
  isDuplicate?: boolean | undefined;
103
94
  }>;
@@ -137,44 +128,44 @@ declare const ReActState: _langchain_langgraph.AnnotationRoot<{
137
128
  content: string;
138
129
  name?: string | undefined;
139
130
  tool_call_id?: string | undefined;
140
- metadata?: Record<string, any> | undefined;
131
+ metadata?: _agentforge_core.JsonObject | undefined;
141
132
  }[], {
142
133
  role: "system" | "user" | "assistant" | "tool";
143
134
  content: string;
144
135
  name?: string | undefined;
145
136
  tool_call_id?: string | undefined;
146
- metadata?: Record<string, any> | undefined;
137
+ metadata?: _agentforge_core.JsonObject | undefined;
147
138
  }[], unknown>;
148
139
  thoughts: _langchain_langgraph.BaseChannel<{
149
140
  content: string;
150
- metadata?: Record<string, any> | undefined;
141
+ metadata?: _agentforge_core.JsonObject | undefined;
151
142
  timestamp?: number | undefined;
152
143
  }[], {
153
144
  content: string;
154
- metadata?: Record<string, any> | undefined;
145
+ metadata?: _agentforge_core.JsonObject | undefined;
155
146
  timestamp?: number | undefined;
156
147
  }[], unknown>;
157
148
  actions: _langchain_langgraph.BaseChannel<{
158
149
  name: string;
159
150
  id: string;
160
- arguments: Record<string, any>;
151
+ arguments: Record<string, unknown>;
161
152
  timestamp?: number | undefined;
162
153
  }[], {
163
154
  name: string;
164
155
  id: string;
165
- arguments: Record<string, any>;
156
+ arguments: Record<string, unknown>;
166
157
  timestamp?: number | undefined;
167
158
  }[], unknown>;
168
159
  observations: _langchain_langgraph.BaseChannel<{
169
160
  toolCallId: string;
170
161
  timestamp?: number | undefined;
171
- result?: any;
162
+ result?: unknown;
172
163
  error?: string | undefined;
173
164
  isDuplicate?: boolean | undefined;
174
165
  }[], {
175
166
  toolCallId: string;
176
167
  timestamp?: number | undefined;
177
- result?: any;
168
+ result?: unknown;
178
169
  error?: string | undefined;
179
170
  isDuplicate?: boolean | undefined;
180
171
  }[], unknown>;
@@ -2388,16 +2379,6 @@ declare function createReflectionAgent(config: ReflectionAgentConfig): _langchai
2388
2379
  finisher: Partial<ReflectionStateType>;
2389
2380
  }, unknown, unknown>;
2390
2381
 
2391
- /**
2392
- * Zod Schemas for Multi-Agent Coordination Pattern
2393
- *
2394
- * This module defines the validation schemas for the Multi-Agent pattern.
2395
- * The pattern enables multiple specialized agents to collaborate on complex tasks
2396
- * through a supervisor that routes work and coordinates execution.
2397
- *
2398
- * @module patterns/multi-agent/schemas
2399
- */
2400
-
2401
2382
  /**
2402
2383
  * Schema for agent roles in the system
2403
2384
  */
@@ -2435,27 +2416,27 @@ declare const AgentMessageSchema: z.ZodObject<{
2435
2416
  /**
2436
2417
  * Optional metadata
2437
2418
  */
2438
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2419
+ metadata: z.ZodOptional<z.ZodType<_agentforge_core.JsonObject, z.ZodTypeDef, _agentforge_core.JsonObject>>;
2439
2420
  /**
2440
2421
  * Timestamp when message was created
2441
2422
  */
2442
2423
  timestamp: z.ZodNumber;
2443
2424
  }, "strip", z.ZodTypeAny, {
2444
- content: string;
2445
2425
  type: "error" | "user_input" | "task_assignment" | "task_result" | "handoff" | "completion";
2426
+ content: string;
2446
2427
  timestamp: number;
2447
2428
  id: string;
2448
2429
  from: string;
2449
2430
  to: string | string[];
2450
- metadata?: Record<string, any> | undefined;
2431
+ metadata?: _agentforge_core.JsonObject | undefined;
2451
2432
  }, {
2452
- content: string;
2453
2433
  type: "error" | "user_input" | "task_assignment" | "task_result" | "handoff" | "completion";
2434
+ content: string;
2454
2435
  timestamp: number;
2455
2436
  id: string;
2456
2437
  from: string;
2457
2438
  to: string | string[];
2458
- metadata?: Record<string, any> | undefined;
2439
+ metadata?: _agentforge_core.JsonObject | undefined;
2459
2440
  }>;
2460
2441
  type AgentMessage = z.infer<typeof AgentMessageSchema>;
2461
2442
  /**
@@ -2638,14 +2619,14 @@ declare const TaskResultSchema: z.ZodObject<{
2638
2619
  /**
2639
2620
  * Optional metadata about execution
2640
2621
  */
2641
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2622
+ metadata: z.ZodOptional<z.ZodType<_agentforge_core.JsonObject, z.ZodTypeDef, _agentforge_core.JsonObject>>;
2642
2623
  }, "strip", z.ZodTypeAny, {
2643
2624
  result: string;
2644
2625
  success: boolean;
2645
2626
  workerId: string;
2646
2627
  assignmentId: string;
2647
2628
  completedAt: number;
2648
- metadata?: Record<string, any> | undefined;
2629
+ metadata?: _agentforge_core.JsonObject | undefined;
2649
2630
  error?: string | undefined;
2650
2631
  }, {
2651
2632
  result: string;
@@ -2653,7 +2634,7 @@ declare const TaskResultSchema: z.ZodObject<{
2653
2634
  workerId: string;
2654
2635
  assignmentId: string;
2655
2636
  completedAt: number;
2656
- metadata?: Record<string, any> | undefined;
2637
+ metadata?: _agentforge_core.JsonObject | undefined;
2657
2638
  error?: string | undefined;
2658
2639
  }>;
2659
2640
  type TaskResult = z.infer<typeof TaskResultSchema>;
@@ -2681,7 +2662,7 @@ declare const HandoffRequestSchema: z.ZodObject<{
2681
2662
  /**
2682
2663
  * Context to pass to next agent
2683
2664
  */
2684
- context: z.ZodAny;
2665
+ context: z.ZodUnknown;
2685
2666
  /**
2686
2667
  * Timestamp of handoff request
2687
2668
  */
@@ -2691,13 +2672,13 @@ declare const HandoffRequestSchema: z.ZodObject<{
2691
2672
  reason: string;
2692
2673
  from: string;
2693
2674
  to: string;
2694
- context?: any;
2675
+ context?: unknown;
2695
2676
  }, {
2696
2677
  timestamp: string;
2697
2678
  reason: string;
2698
2679
  from: string;
2699
2680
  to: string;
2700
- context?: any;
2681
+ context?: unknown;
2701
2682
  }>;
2702
2683
  type HandoffRequest = z.infer<typeof HandoffRequestSchema>;
2703
2684
 
@@ -2727,33 +2708,33 @@ declare const MultiAgentStateConfig: {
2727
2708
  from: z.ZodString;
2728
2709
  to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
2729
2710
  content: z.ZodString;
2730
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2711
+ metadata: z.ZodOptional<z.ZodType<_agentforge_core.JsonObject, z.ZodTypeDef, _agentforge_core.JsonObject>>;
2731
2712
  timestamp: z.ZodNumber;
2732
2713
  }, "strip", z.ZodTypeAny, {
2733
- content: string;
2734
2714
  type: "error" | "user_input" | "task_assignment" | "task_result" | "handoff" | "completion";
2715
+ content: string;
2735
2716
  timestamp: number;
2736
2717
  id: string;
2737
2718
  from: string;
2738
2719
  to: string | string[];
2739
- metadata?: Record<string, any> | undefined;
2720
+ metadata?: _agentforge_core.JsonObject | undefined;
2740
2721
  }, {
2741
- content: string;
2742
2722
  type: "error" | "user_input" | "task_assignment" | "task_result" | "handoff" | "completion";
2723
+ content: string;
2743
2724
  timestamp: number;
2744
2725
  id: string;
2745
2726
  from: string;
2746
2727
  to: string | string[];
2747
- metadata?: Record<string, any> | undefined;
2728
+ metadata?: _agentforge_core.JsonObject | undefined;
2748
2729
  }>, "many">;
2749
2730
  reducer: (left: AgentMessage[], right: AgentMessage[]) => {
2750
- content: string;
2751
2731
  type: "error" | "user_input" | "task_assignment" | "task_result" | "handoff" | "completion";
2732
+ content: string;
2752
2733
  timestamp: number;
2753
2734
  id: string;
2754
2735
  from: string;
2755
2736
  to: string | string[];
2756
- metadata?: Record<string, any> | undefined;
2737
+ metadata?: _agentforge_core.JsonObject | undefined;
2757
2738
  }[];
2758
2739
  default: () => never[];
2759
2740
  description: string;
@@ -2897,14 +2878,14 @@ declare const MultiAgentStateConfig: {
2897
2878
  result: z.ZodString;
2898
2879
  error: z.ZodOptional<z.ZodString>;
2899
2880
  completedAt: z.ZodNumber;
2900
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2881
+ metadata: z.ZodOptional<z.ZodType<_agentforge_core.JsonObject, z.ZodTypeDef, _agentforge_core.JsonObject>>;
2901
2882
  }, "strip", z.ZodTypeAny, {
2902
2883
  result: string;
2903
2884
  success: boolean;
2904
2885
  workerId: string;
2905
2886
  assignmentId: string;
2906
2887
  completedAt: number;
2907
- metadata?: Record<string, any> | undefined;
2888
+ metadata?: _agentforge_core.JsonObject | undefined;
2908
2889
  error?: string | undefined;
2909
2890
  }, {
2910
2891
  result: string;
@@ -2912,7 +2893,7 @@ declare const MultiAgentStateConfig: {
2912
2893
  workerId: string;
2913
2894
  assignmentId: string;
2914
2895
  completedAt: number;
2915
- metadata?: Record<string, any> | undefined;
2896
+ metadata?: _agentforge_core.JsonObject | undefined;
2916
2897
  error?: string | undefined;
2917
2898
  }>, "many">;
2918
2899
  reducer: (left: TaskResult[], right: TaskResult[]) => {
@@ -2921,7 +2902,7 @@ declare const MultiAgentStateConfig: {
2921
2902
  workerId: string;
2922
2903
  assignmentId: string;
2923
2904
  completedAt: number;
2924
- metadata?: Record<string, any> | undefined;
2905
+ metadata?: _agentforge_core.JsonObject | undefined;
2925
2906
  error?: string | undefined;
2926
2907
  }[];
2927
2908
  default: () => never[];
@@ -2936,27 +2917,27 @@ declare const MultiAgentStateConfig: {
2936
2917
  from: z.ZodString;
2937
2918
  to: z.ZodString;
2938
2919
  reason: z.ZodString;
2939
- context: z.ZodAny;
2920
+ context: z.ZodUnknown;
2940
2921
  timestamp: z.ZodString;
2941
2922
  }, "strip", z.ZodTypeAny, {
2942
2923
  timestamp: string;
2943
2924
  reason: string;
2944
2925
  from: string;
2945
2926
  to: string;
2946
- context?: any;
2927
+ context?: unknown;
2947
2928
  }, {
2948
2929
  timestamp: string;
2949
2930
  reason: string;
2950
2931
  from: string;
2951
2932
  to: string;
2952
- context?: any;
2933
+ context?: unknown;
2953
2934
  }>, "many">;
2954
2935
  reducer: (left: HandoffRequest[], right: HandoffRequest[]) => {
2955
2936
  timestamp: string;
2956
2937
  reason: string;
2957
2938
  from: string;
2958
2939
  to: string;
2959
- context?: any;
2940
+ context?: unknown;
2960
2941
  }[];
2961
2942
  default: () => never[];
2962
2943
  description: string;
@@ -3009,21 +2990,21 @@ declare const MultiAgentStateConfig: {
3009
2990
  declare const MultiAgentState: _langchain_langgraph.AnnotationRoot<{
3010
2991
  input: _langchain_langgraph.BaseChannel<string, string, unknown>;
3011
2992
  messages: _langchain_langgraph.BaseChannel<{
3012
- content: string;
3013
2993
  type: "error" | "user_input" | "task_assignment" | "task_result" | "handoff" | "completion";
2994
+ content: string;
3014
2995
  timestamp: number;
3015
2996
  id: string;
3016
2997
  from: string;
3017
2998
  to: string | string[];
3018
- metadata?: Record<string, any> | undefined;
2999
+ metadata?: _agentforge_core.JsonObject | undefined;
3019
3000
  }[], {
3020
- content: string;
3021
3001
  type: "error" | "user_input" | "task_assignment" | "task_result" | "handoff" | "completion";
3002
+ content: string;
3022
3003
  timestamp: number;
3023
3004
  id: string;
3024
3005
  from: string;
3025
3006
  to: string | string[];
3026
- metadata?: Record<string, any> | undefined;
3007
+ metadata?: _agentforge_core.JsonObject | undefined;
3027
3008
  }[], unknown>;
3028
3009
  workers: _langchain_langgraph.BaseChannel<Record<string, {
3029
3010
  tools: string[];
@@ -3073,7 +3054,7 @@ declare const MultiAgentState: _langchain_langgraph.AnnotationRoot<{
3073
3054
  workerId: string;
3074
3055
  assignmentId: string;
3075
3056
  completedAt: number;
3076
- metadata?: Record<string, any> | undefined;
3057
+ metadata?: _agentforge_core.JsonObject | undefined;
3077
3058
  error?: string | undefined;
3078
3059
  }[], {
3079
3060
  result: string;
@@ -3081,7 +3062,7 @@ declare const MultiAgentState: _langchain_langgraph.AnnotationRoot<{
3081
3062
  workerId: string;
3082
3063
  assignmentId: string;
3083
3064
  completedAt: number;
3084
- metadata?: Record<string, any> | undefined;
3065
+ metadata?: _agentforge_core.JsonObject | undefined;
3085
3066
  error?: string | undefined;
3086
3067
  }[], unknown>;
3087
3068
  handoffs: _langchain_langgraph.BaseChannel<{
@@ -3089,13 +3070,13 @@ declare const MultiAgentState: _langchain_langgraph.AnnotationRoot<{
3089
3070
  reason: string;
3090
3071
  from: string;
3091
3072
  to: string;
3092
- context?: any;
3073
+ context?: unknown;
3093
3074
  }[], {
3094
3075
  timestamp: string;
3095
3076
  reason: string;
3096
3077
  from: string;
3097
3078
  to: string;
3098
- context?: any;
3079
+ context?: unknown;
3099
3080
  }[], unknown>;
3100
3081
  status: _langchain_langgraph.BaseChannel<"failed" | "executing" | "completed" | "initializing" | "routing" | "coordinating" | "aggregating", "failed" | "executing" | "completed" | "initializing" | "routing" | "coordinating" | "aggregating", unknown>;
3101
3082
  iteration: _langchain_langgraph.BaseChannel<number, number, unknown>;