@copilotkit/sdk-js 1.51.5-next.0 → 1.51.5-next.2
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/CHANGELOG.md +12 -0
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/index.cjs +0 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +1 -1
- package/dist/langchain.cjs +18 -0
- package/dist/langchain.cjs.map +1 -0
- package/dist/langchain.d.cts +3 -0
- package/dist/langchain.d.mts +4 -0
- package/dist/langchain.mjs +6 -23
- package/dist/langchain.mjs.map +1 -1
- package/dist/langgraph/middleware.cjs +139 -0
- package/dist/langgraph/middleware.cjs.map +1 -0
- package/dist/langgraph/middleware.d.cts +8 -0
- package/dist/langgraph/middleware.d.cts.map +1 -0
- package/dist/langgraph/middleware.d.mts +8 -0
- package/dist/langgraph/middleware.d.mts.map +1 -0
- package/dist/langgraph/middleware.mjs +137 -0
- package/dist/langgraph/middleware.mjs.map +1 -0
- package/dist/langgraph/types.cjs +19 -0
- package/dist/langgraph/types.cjs.map +1 -0
- package/dist/langgraph/types.d.cts +246 -0
- package/dist/langgraph/types.d.cts.map +1 -0
- package/dist/langgraph/types.d.mts +246 -0
- package/dist/langgraph/types.d.mts.map +1 -0
- package/dist/langgraph/types.mjs +17 -0
- package/dist/langgraph/types.mjs.map +1 -0
- package/dist/langgraph/utils.cjs +281 -0
- package/dist/langgraph/utils.cjs.map +1 -0
- package/dist/langgraph/utils.d.cts +192 -0
- package/dist/langgraph/utils.d.cts.map +1 -0
- package/dist/langgraph/utils.d.mts +192 -0
- package/dist/langgraph/utils.d.mts.map +1 -0
- package/dist/langgraph/utils.mjs +273 -0
- package/dist/langgraph/utils.mjs.map +1 -0
- package/dist/langgraph.cjs +16 -0
- package/dist/langgraph.d.cts +4 -0
- package/dist/langgraph.d.mts +4 -0
- package/dist/langgraph.mjs +5 -27
- package/package.json +22 -22
- package/tsdown.config.ts +17 -0
- package/vitest.config.mjs +11 -0
- package/dist/chunk-A7ZQHBQI.mjs +0 -505
- package/dist/chunk-A7ZQHBQI.mjs.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/langchain-db7cb6cb.d.ts +0 -427
- package/dist/langchain.d.ts +0 -6
- package/dist/langchain.js +0 -284
- package/dist/langchain.js.map +0 -1
- package/dist/langgraph/index.d.ts +0 -10
- package/dist/langgraph.js +0 -548
- package/dist/langgraph.js.map +0 -1
- package/dist/langgraph.mjs.map +0 -1
- package/jest.config.js +0 -5
- package/tsup.config.ts +0 -23
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import * as _langchain_langgraph0 from "@langchain/langgraph";
|
|
2
|
+
import * as _langchain_core_messages0 from "@langchain/core/messages";
|
|
3
|
+
import * as langchain from "langchain";
|
|
4
|
+
|
|
5
|
+
//#region src/langgraph/types.d.ts
|
|
6
|
+
declare const CopilotKitPropertiesAnnotation: _langchain_langgraph0.AnnotationRoot<{
|
|
7
|
+
actions: {
|
|
8
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
9
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
10
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
11
|
+
};
|
|
12
|
+
context: {
|
|
13
|
+
(): _langchain_langgraph0.LastValue<{
|
|
14
|
+
description: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[]>;
|
|
17
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
18
|
+
description: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}[], {
|
|
21
|
+
description: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
24
|
+
description: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[], {
|
|
27
|
+
description: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}[]>;
|
|
30
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
31
|
+
};
|
|
32
|
+
interceptedToolCalls: {
|
|
33
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
34
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
35
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
36
|
+
};
|
|
37
|
+
originalAIMessageId: {
|
|
38
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
39
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
40
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
41
|
+
};
|
|
42
|
+
}>;
|
|
43
|
+
declare const CopilotKitStateAnnotation: _langchain_langgraph0.AnnotationRoot<{
|
|
44
|
+
messages: _langchain_langgraph0.BinaryOperatorAggregate<langchain.BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], _langchain_langgraph0.Messages>;
|
|
45
|
+
copilotkit: {
|
|
46
|
+
(): _langchain_langgraph0.LastValue<_langchain_langgraph0.StateType<{
|
|
47
|
+
actions: {
|
|
48
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
49
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
50
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
51
|
+
};
|
|
52
|
+
context: {
|
|
53
|
+
(): _langchain_langgraph0.LastValue<{
|
|
54
|
+
description: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}[]>;
|
|
57
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
58
|
+
description: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}[], {
|
|
61
|
+
description: string;
|
|
62
|
+
value: string;
|
|
63
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
64
|
+
description: string;
|
|
65
|
+
value: string;
|
|
66
|
+
}[], {
|
|
67
|
+
description: string;
|
|
68
|
+
value: string;
|
|
69
|
+
}[]>;
|
|
70
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
71
|
+
};
|
|
72
|
+
interceptedToolCalls: {
|
|
73
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
74
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
75
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
76
|
+
};
|
|
77
|
+
originalAIMessageId: {
|
|
78
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
79
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
80
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
81
|
+
};
|
|
82
|
+
}>>;
|
|
83
|
+
(annotation: _langchain_langgraph0.SingleReducer<_langchain_langgraph0.StateType<{
|
|
84
|
+
actions: {
|
|
85
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
86
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
87
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
88
|
+
};
|
|
89
|
+
context: {
|
|
90
|
+
(): _langchain_langgraph0.LastValue<{
|
|
91
|
+
description: string;
|
|
92
|
+
value: string;
|
|
93
|
+
}[]>;
|
|
94
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
95
|
+
description: string;
|
|
96
|
+
value: string;
|
|
97
|
+
}[], {
|
|
98
|
+
description: string;
|
|
99
|
+
value: string;
|
|
100
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
101
|
+
description: string;
|
|
102
|
+
value: string;
|
|
103
|
+
}[], {
|
|
104
|
+
description: string;
|
|
105
|
+
value: string;
|
|
106
|
+
}[]>;
|
|
107
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
108
|
+
};
|
|
109
|
+
interceptedToolCalls: {
|
|
110
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
111
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
112
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
113
|
+
};
|
|
114
|
+
originalAIMessageId: {
|
|
115
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
116
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
117
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
118
|
+
};
|
|
119
|
+
}>, _langchain_langgraph0.StateType<{
|
|
120
|
+
actions: {
|
|
121
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
122
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
123
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
124
|
+
};
|
|
125
|
+
context: {
|
|
126
|
+
(): _langchain_langgraph0.LastValue<{
|
|
127
|
+
description: string;
|
|
128
|
+
value: string;
|
|
129
|
+
}[]>;
|
|
130
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
131
|
+
description: string;
|
|
132
|
+
value: string;
|
|
133
|
+
}[], {
|
|
134
|
+
description: string;
|
|
135
|
+
value: string;
|
|
136
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
137
|
+
description: string;
|
|
138
|
+
value: string;
|
|
139
|
+
}[], {
|
|
140
|
+
description: string;
|
|
141
|
+
value: string;
|
|
142
|
+
}[]>;
|
|
143
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
144
|
+
};
|
|
145
|
+
interceptedToolCalls: {
|
|
146
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
147
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
148
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
149
|
+
};
|
|
150
|
+
originalAIMessageId: {
|
|
151
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
152
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
153
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
154
|
+
};
|
|
155
|
+
}>>): _langchain_langgraph0.BinaryOperatorAggregate<_langchain_langgraph0.StateType<{
|
|
156
|
+
actions: {
|
|
157
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
158
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
159
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
160
|
+
};
|
|
161
|
+
context: {
|
|
162
|
+
(): _langchain_langgraph0.LastValue<{
|
|
163
|
+
description: string;
|
|
164
|
+
value: string;
|
|
165
|
+
}[]>;
|
|
166
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
167
|
+
description: string;
|
|
168
|
+
value: string;
|
|
169
|
+
}[], {
|
|
170
|
+
description: string;
|
|
171
|
+
value: string;
|
|
172
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
173
|
+
description: string;
|
|
174
|
+
value: string;
|
|
175
|
+
}[], {
|
|
176
|
+
description: string;
|
|
177
|
+
value: string;
|
|
178
|
+
}[]>;
|
|
179
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
180
|
+
};
|
|
181
|
+
interceptedToolCalls: {
|
|
182
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
183
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
184
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
185
|
+
};
|
|
186
|
+
originalAIMessageId: {
|
|
187
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
188
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
189
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
190
|
+
};
|
|
191
|
+
}>, _langchain_langgraph0.StateType<{
|
|
192
|
+
actions: {
|
|
193
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
194
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
195
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
196
|
+
};
|
|
197
|
+
context: {
|
|
198
|
+
(): _langchain_langgraph0.LastValue<{
|
|
199
|
+
description: string;
|
|
200
|
+
value: string;
|
|
201
|
+
}[]>;
|
|
202
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
203
|
+
description: string;
|
|
204
|
+
value: string;
|
|
205
|
+
}[], {
|
|
206
|
+
description: string;
|
|
207
|
+
value: string;
|
|
208
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
209
|
+
description: string;
|
|
210
|
+
value: string;
|
|
211
|
+
}[], {
|
|
212
|
+
description: string;
|
|
213
|
+
value: string;
|
|
214
|
+
}[]>;
|
|
215
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
216
|
+
};
|
|
217
|
+
interceptedToolCalls: {
|
|
218
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
219
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
220
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
221
|
+
};
|
|
222
|
+
originalAIMessageId: {
|
|
223
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
224
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
225
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
226
|
+
};
|
|
227
|
+
}>>;
|
|
228
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
229
|
+
};
|
|
230
|
+
}>;
|
|
231
|
+
interface IntermediateStateConfig {
|
|
232
|
+
stateKey: string;
|
|
233
|
+
tool: string;
|
|
234
|
+
toolArgument?: string;
|
|
235
|
+
}
|
|
236
|
+
interface OptionsConfig {
|
|
237
|
+
emitToolCalls?: boolean | string | string[];
|
|
238
|
+
emitMessages?: boolean;
|
|
239
|
+
emitAll?: boolean;
|
|
240
|
+
emitIntermediateState?: IntermediateStateConfig[];
|
|
241
|
+
}
|
|
242
|
+
type CopilotKitState = typeof CopilotKitStateAnnotation.State;
|
|
243
|
+
type CopilotKitProperties = typeof CopilotKitPropertiesAnnotation.State;
|
|
244
|
+
//#endregion
|
|
245
|
+
export { CopilotKitProperties, CopilotKitPropertiesAnnotation, CopilotKitState, CopilotKitStateAnnotation, IntermediateStateConfig, OptionsConfig };
|
|
246
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/langgraph/types.ts"],"mappings":";;;;;cAEa,8BAAA,wBAA8B,cAAA;;QAKzC,qBAAA,CAAA,SAAA;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,yBAAA,wBAAyB,cAAA;2HAGpC,yBAAA,CAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAEe,uBAAA;EACf,QAAA;EACA,IAAA;EACA,YAAA;AAAA;AAAA,UAGe,aAAA;EACf,aAAA;EACA,YAAA;EACA,OAAA;EACA,qBAAA,GAAwB,uBAAA;AAAA;AAAA,KAGd,eAAA,UAAyB,yBAAA,CAA0B,KAAA;AAAA,KACnD,oBAAA,UAA8B,8BAAA,CAA+B,KAAA"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import * as _langchain_langgraph0 from "@langchain/langgraph";
|
|
2
|
+
import * as _langchain_core_messages0 from "@langchain/core/messages";
|
|
3
|
+
import * as langchain from "langchain";
|
|
4
|
+
|
|
5
|
+
//#region src/langgraph/types.d.ts
|
|
6
|
+
declare const CopilotKitPropertiesAnnotation: _langchain_langgraph0.AnnotationRoot<{
|
|
7
|
+
actions: {
|
|
8
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
9
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
10
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
11
|
+
};
|
|
12
|
+
context: {
|
|
13
|
+
(): _langchain_langgraph0.LastValue<{
|
|
14
|
+
description: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[]>;
|
|
17
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
18
|
+
description: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}[], {
|
|
21
|
+
description: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
24
|
+
description: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[], {
|
|
27
|
+
description: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}[]>;
|
|
30
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
31
|
+
};
|
|
32
|
+
interceptedToolCalls: {
|
|
33
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
34
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
35
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
36
|
+
};
|
|
37
|
+
originalAIMessageId: {
|
|
38
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
39
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
40
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
41
|
+
};
|
|
42
|
+
}>;
|
|
43
|
+
declare const CopilotKitStateAnnotation: _langchain_langgraph0.AnnotationRoot<{
|
|
44
|
+
messages: _langchain_langgraph0.BinaryOperatorAggregate<langchain.BaseMessage<_langchain_core_messages0.MessageStructure<_langchain_core_messages0.MessageToolSet>, _langchain_core_messages0.MessageType>[], _langchain_langgraph0.Messages>;
|
|
45
|
+
copilotkit: {
|
|
46
|
+
(): _langchain_langgraph0.LastValue<_langchain_langgraph0.StateType<{
|
|
47
|
+
actions: {
|
|
48
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
49
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
50
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
51
|
+
};
|
|
52
|
+
context: {
|
|
53
|
+
(): _langchain_langgraph0.LastValue<{
|
|
54
|
+
description: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}[]>;
|
|
57
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
58
|
+
description: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}[], {
|
|
61
|
+
description: string;
|
|
62
|
+
value: string;
|
|
63
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
64
|
+
description: string;
|
|
65
|
+
value: string;
|
|
66
|
+
}[], {
|
|
67
|
+
description: string;
|
|
68
|
+
value: string;
|
|
69
|
+
}[]>;
|
|
70
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
71
|
+
};
|
|
72
|
+
interceptedToolCalls: {
|
|
73
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
74
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
75
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
76
|
+
};
|
|
77
|
+
originalAIMessageId: {
|
|
78
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
79
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
80
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
81
|
+
};
|
|
82
|
+
}>>;
|
|
83
|
+
(annotation: _langchain_langgraph0.SingleReducer<_langchain_langgraph0.StateType<{
|
|
84
|
+
actions: {
|
|
85
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
86
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
87
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
88
|
+
};
|
|
89
|
+
context: {
|
|
90
|
+
(): _langchain_langgraph0.LastValue<{
|
|
91
|
+
description: string;
|
|
92
|
+
value: string;
|
|
93
|
+
}[]>;
|
|
94
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
95
|
+
description: string;
|
|
96
|
+
value: string;
|
|
97
|
+
}[], {
|
|
98
|
+
description: string;
|
|
99
|
+
value: string;
|
|
100
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
101
|
+
description: string;
|
|
102
|
+
value: string;
|
|
103
|
+
}[], {
|
|
104
|
+
description: string;
|
|
105
|
+
value: string;
|
|
106
|
+
}[]>;
|
|
107
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
108
|
+
};
|
|
109
|
+
interceptedToolCalls: {
|
|
110
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
111
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
112
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
113
|
+
};
|
|
114
|
+
originalAIMessageId: {
|
|
115
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
116
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
117
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
118
|
+
};
|
|
119
|
+
}>, _langchain_langgraph0.StateType<{
|
|
120
|
+
actions: {
|
|
121
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
122
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
123
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
124
|
+
};
|
|
125
|
+
context: {
|
|
126
|
+
(): _langchain_langgraph0.LastValue<{
|
|
127
|
+
description: string;
|
|
128
|
+
value: string;
|
|
129
|
+
}[]>;
|
|
130
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
131
|
+
description: string;
|
|
132
|
+
value: string;
|
|
133
|
+
}[], {
|
|
134
|
+
description: string;
|
|
135
|
+
value: string;
|
|
136
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
137
|
+
description: string;
|
|
138
|
+
value: string;
|
|
139
|
+
}[], {
|
|
140
|
+
description: string;
|
|
141
|
+
value: string;
|
|
142
|
+
}[]>;
|
|
143
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
144
|
+
};
|
|
145
|
+
interceptedToolCalls: {
|
|
146
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
147
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
148
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
149
|
+
};
|
|
150
|
+
originalAIMessageId: {
|
|
151
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
152
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
153
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
154
|
+
};
|
|
155
|
+
}>>): _langchain_langgraph0.BinaryOperatorAggregate<_langchain_langgraph0.StateType<{
|
|
156
|
+
actions: {
|
|
157
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
158
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
159
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
160
|
+
};
|
|
161
|
+
context: {
|
|
162
|
+
(): _langchain_langgraph0.LastValue<{
|
|
163
|
+
description: string;
|
|
164
|
+
value: string;
|
|
165
|
+
}[]>;
|
|
166
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
167
|
+
description: string;
|
|
168
|
+
value: string;
|
|
169
|
+
}[], {
|
|
170
|
+
description: string;
|
|
171
|
+
value: string;
|
|
172
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
173
|
+
description: string;
|
|
174
|
+
value: string;
|
|
175
|
+
}[], {
|
|
176
|
+
description: string;
|
|
177
|
+
value: string;
|
|
178
|
+
}[]>;
|
|
179
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
180
|
+
};
|
|
181
|
+
interceptedToolCalls: {
|
|
182
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
183
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
184
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
185
|
+
};
|
|
186
|
+
originalAIMessageId: {
|
|
187
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
188
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
189
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
190
|
+
};
|
|
191
|
+
}>, _langchain_langgraph0.StateType<{
|
|
192
|
+
actions: {
|
|
193
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
194
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
195
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
196
|
+
};
|
|
197
|
+
context: {
|
|
198
|
+
(): _langchain_langgraph0.LastValue<{
|
|
199
|
+
description: string;
|
|
200
|
+
value: string;
|
|
201
|
+
}[]>;
|
|
202
|
+
(annotation: _langchain_langgraph0.SingleReducer<{
|
|
203
|
+
description: string;
|
|
204
|
+
value: string;
|
|
205
|
+
}[], {
|
|
206
|
+
description: string;
|
|
207
|
+
value: string;
|
|
208
|
+
}[]>): _langchain_langgraph0.BinaryOperatorAggregate<{
|
|
209
|
+
description: string;
|
|
210
|
+
value: string;
|
|
211
|
+
}[], {
|
|
212
|
+
description: string;
|
|
213
|
+
value: string;
|
|
214
|
+
}[]>;
|
|
215
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
216
|
+
};
|
|
217
|
+
interceptedToolCalls: {
|
|
218
|
+
(): _langchain_langgraph0.LastValue<any[]>;
|
|
219
|
+
(annotation: _langchain_langgraph0.SingleReducer<any[], any[]>): _langchain_langgraph0.BinaryOperatorAggregate<any[], any[]>;
|
|
220
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
221
|
+
};
|
|
222
|
+
originalAIMessageId: {
|
|
223
|
+
(): _langchain_langgraph0.LastValue<string>;
|
|
224
|
+
(annotation: _langchain_langgraph0.SingleReducer<string, string>): _langchain_langgraph0.BinaryOperatorAggregate<string, string>;
|
|
225
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
226
|
+
};
|
|
227
|
+
}>>;
|
|
228
|
+
Root: <S extends _langchain_langgraph0.StateDefinition>(sd: S) => _langchain_langgraph0.AnnotationRoot<S>;
|
|
229
|
+
};
|
|
230
|
+
}>;
|
|
231
|
+
interface IntermediateStateConfig {
|
|
232
|
+
stateKey: string;
|
|
233
|
+
tool: string;
|
|
234
|
+
toolArgument?: string;
|
|
235
|
+
}
|
|
236
|
+
interface OptionsConfig {
|
|
237
|
+
emitToolCalls?: boolean | string | string[];
|
|
238
|
+
emitMessages?: boolean;
|
|
239
|
+
emitAll?: boolean;
|
|
240
|
+
emitIntermediateState?: IntermediateStateConfig[];
|
|
241
|
+
}
|
|
242
|
+
type CopilotKitState = typeof CopilotKitStateAnnotation.State;
|
|
243
|
+
type CopilotKitProperties = typeof CopilotKitPropertiesAnnotation.State;
|
|
244
|
+
//#endregion
|
|
245
|
+
export { CopilotKitProperties, CopilotKitPropertiesAnnotation, CopilotKitState, CopilotKitStateAnnotation, IntermediateStateConfig, OptionsConfig };
|
|
246
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/langgraph/types.ts"],"mappings":";;;;;cAEa,8BAAA,wBAA8B,cAAA;;QAKzC,qBAAA,CAAA,SAAA;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,yBAAA,wBAAyB,cAAA;2HAGpC,yBAAA,CAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAEe,uBAAA;EACf,QAAA;EACA,IAAA;EACA,YAAA;AAAA;AAAA,UAGe,aAAA;EACf,aAAA;EACA,YAAA;EACA,OAAA;EACA,qBAAA,GAAwB,uBAAA;AAAA;AAAA,KAGd,eAAA,UAAyB,yBAAA,CAA0B,KAAA;AAAA,KACnD,oBAAA,UAA8B,8BAAA,CAA+B,KAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Annotation, MessagesAnnotation } from "@langchain/langgraph";
|
|
2
|
+
|
|
3
|
+
//#region src/langgraph/types.ts
|
|
4
|
+
const CopilotKitPropertiesAnnotation = Annotation.Root({
|
|
5
|
+
actions: Annotation,
|
|
6
|
+
context: Annotation,
|
|
7
|
+
interceptedToolCalls: Annotation,
|
|
8
|
+
originalAIMessageId: Annotation
|
|
9
|
+
});
|
|
10
|
+
const CopilotKitStateAnnotation = Annotation.Root({
|
|
11
|
+
copilotkit: Annotation,
|
|
12
|
+
...MessagesAnnotation.spec
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { CopilotKitPropertiesAnnotation, CopilotKitStateAnnotation };
|
|
17
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../../src/langgraph/types.ts"],"sourcesContent":["import { Annotation, MessagesAnnotation } from \"@langchain/langgraph\";\n\nexport const CopilotKitPropertiesAnnotation = Annotation.Root({\n actions: Annotation<any[]>,\n context: Annotation<{ description: string; value: string }[]>,\n interceptedToolCalls: Annotation<any[]>,\n originalAIMessageId: Annotation<string>,\n});\n\nexport const CopilotKitStateAnnotation = Annotation.Root({\n copilotkit: Annotation<typeof CopilotKitPropertiesAnnotation.State>,\n ...MessagesAnnotation.spec,\n});\n\nexport interface IntermediateStateConfig {\n stateKey: string;\n tool: string;\n toolArgument?: string;\n}\n\nexport interface OptionsConfig {\n emitToolCalls?: boolean | string | string[];\n emitMessages?: boolean;\n emitAll?: boolean;\n emitIntermediateState?: IntermediateStateConfig[];\n}\n\nexport type CopilotKitState = typeof CopilotKitStateAnnotation.State;\nexport type CopilotKitProperties = typeof CopilotKitPropertiesAnnotation.State;\n"],"mappings":";;;AAEA,MAAa,iCAAiC,WAAW,KAAK;CAC5D,SAAS;CACT,SAAS;CACT,sBAAsB;CACtB,qBAAqB;CACtB,CAAC;AAEF,MAAa,4BAA4B,WAAW,KAAK;CACvD,YAAY;CACZ,GAAG,mBAAmB;CACvB,CAAC"}
|