@cursor/sdk 1.0.7
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/LICENSE.md +3 -0
- package/README.md +364 -0
- package/dist/cjs/829.index.js +1 -0
- package/dist/cjs/agent.d.ts +153 -0
- package/dist/cjs/agent.d.ts.map +1 -0
- package/dist/cjs/analytics.d.ts +67 -0
- package/dist/cjs/analytics.d.ts.map +1 -0
- package/dist/cjs/artifacts.d.ts +6 -0
- package/dist/cjs/artifacts.d.ts.map +1 -0
- package/dist/cjs/cloud-agent.d.ts +22 -0
- package/dist/cjs/cloud-agent.d.ts.map +1 -0
- package/dist/cjs/cloud-api-client.d.ts +192 -0
- package/dist/cjs/cloud-api-client.d.ts.map +1 -0
- package/dist/cjs/cloud-executor.d.ts +14 -0
- package/dist/cjs/cloud-executor.d.ts.map +1 -0
- package/dist/cjs/cloud-mcp-utils.d.ts +4 -0
- package/dist/cjs/cloud-mcp-utils.d.ts.map +1 -0
- package/dist/cjs/core-adapter.d.ts +2 -0
- package/dist/cjs/core-adapter.d.ts.map +1 -0
- package/dist/cjs/errors.d.ts +96 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/executor-common.d.ts +16 -0
- package/dist/cjs/executor-common.d.ts.map +1 -0
- package/dist/cjs/executor-types.d.ts +59 -0
- package/dist/cjs/executor-types.d.ts.map +1 -0
- package/dist/cjs/index.d.ts +17 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.LICENSE.txt +274 -0
- package/dist/cjs/local-executor.d.ts +15 -0
- package/dist/cjs/local-executor.d.ts.map +1 -0
- package/dist/cjs/messages.d.ts +110 -0
- package/dist/cjs/messages.d.ts.map +1 -0
- package/dist/cjs/options.d.ts +122 -0
- package/dist/cjs/options.d.ts.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/platform.d.ts +42 -0
- package/dist/cjs/platform.d.ts.map +1 -0
- package/dist/cjs/public-api.d.ts +12 -0
- package/dist/cjs/public-api.d.ts.map +1 -0
- package/dist/cjs/run-event-tailer.d.ts +33 -0
- package/dist/cjs/run-event-tailer.d.ts.map +1 -0
- package/dist/cjs/run-interaction-accumulator.d.ts +32 -0
- package/dist/cjs/run-interaction-accumulator.d.ts.map +1 -0
- package/dist/cjs/run.d.ts +44 -0
- package/dist/cjs/run.d.ts.map +1 -0
- package/dist/cjs/stubs.d.ts +95 -0
- package/dist/cjs/stubs.d.ts.map +1 -0
- package/dist/cjs/subagent-conversion.d.ts +9 -0
- package/dist/cjs/subagent-conversion.d.ts.map +1 -0
- package/dist/cjs/tool-call-utils.d.ts +7 -0
- package/dist/cjs/tool-call-utils.d.ts.map +1 -0
- package/dist/cjs/types/conversation-types.d.ts +12062 -0
- package/dist/cjs/types/conversation-types.d.ts.map +1 -0
- package/dist/cjs/types/delta-types.d.ts +2 -0
- package/dist/cjs/types/delta-types.d.ts.map +1 -0
- package/dist/cjs/types/tool-call-types.d.ts +2 -0
- package/dist/cjs/types/tool-call-types.d.ts.map +1 -0
- package/dist/cjs/utils/conversation-utils.d.ts +3 -0
- package/dist/cjs/utils/conversation-utils.d.ts.map +1 -0
- package/dist/cjs/utils/logger.d.ts +12 -0
- package/dist/cjs/utils/logger.d.ts.map +1 -0
- package/dist/cjs/utils/message-schemas.d.ts +2 -0
- package/dist/cjs/utils/message-schemas.d.ts.map +1 -0
- package/dist/esm/829.index.js +1 -0
- package/dist/esm/agent.d.ts +153 -0
- package/dist/esm/agent.d.ts.map +1 -0
- package/dist/esm/analytics.d.ts +67 -0
- package/dist/esm/analytics.d.ts.map +1 -0
- package/dist/esm/artifacts.d.ts +6 -0
- package/dist/esm/artifacts.d.ts.map +1 -0
- package/dist/esm/cloud-agent.d.ts +22 -0
- package/dist/esm/cloud-agent.d.ts.map +1 -0
- package/dist/esm/cloud-api-client.d.ts +192 -0
- package/dist/esm/cloud-api-client.d.ts.map +1 -0
- package/dist/esm/cloud-executor.d.ts +14 -0
- package/dist/esm/cloud-executor.d.ts.map +1 -0
- package/dist/esm/cloud-mcp-utils.d.ts +4 -0
- package/dist/esm/cloud-mcp-utils.d.ts.map +1 -0
- package/dist/esm/core-adapter.d.ts +2 -0
- package/dist/esm/core-adapter.d.ts.map +1 -0
- package/dist/esm/errors.d.ts +96 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/executor-common.d.ts +16 -0
- package/dist/esm/executor-common.d.ts.map +1 -0
- package/dist/esm/executor-types.d.ts +59 -0
- package/dist/esm/executor-types.d.ts.map +1 -0
- package/dist/esm/index.d.ts +17 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.LICENSE.txt +274 -0
- package/dist/esm/local-executor.d.ts +15 -0
- package/dist/esm/local-executor.d.ts.map +1 -0
- package/dist/esm/messages.d.ts +110 -0
- package/dist/esm/messages.d.ts.map +1 -0
- package/dist/esm/options.d.ts +122 -0
- package/dist/esm/options.d.ts.map +1 -0
- package/dist/esm/platform.d.ts +42 -0
- package/dist/esm/platform.d.ts.map +1 -0
- package/dist/esm/public-api.d.ts +12 -0
- package/dist/esm/public-api.d.ts.map +1 -0
- package/dist/esm/run-event-tailer.d.ts +33 -0
- package/dist/esm/run-event-tailer.d.ts.map +1 -0
- package/dist/esm/run-interaction-accumulator.d.ts +32 -0
- package/dist/esm/run-interaction-accumulator.d.ts.map +1 -0
- package/dist/esm/run.d.ts +44 -0
- package/dist/esm/run.d.ts.map +1 -0
- package/dist/esm/stubs.d.ts +95 -0
- package/dist/esm/stubs.d.ts.map +1 -0
- package/dist/esm/subagent-conversion.d.ts +9 -0
- package/dist/esm/subagent-conversion.d.ts.map +1 -0
- package/dist/esm/tool-call-utils.d.ts +7 -0
- package/dist/esm/tool-call-utils.d.ts.map +1 -0
- package/dist/esm/types/conversation-types.d.ts +12062 -0
- package/dist/esm/types/conversation-types.d.ts.map +1 -0
- package/dist/esm/types/delta-types.d.ts +2 -0
- package/dist/esm/types/delta-types.d.ts.map +1 -0
- package/dist/esm/types/tool-call-types.d.ts +2 -0
- package/dist/esm/types/tool-call-types.d.ts.map +1 -0
- package/dist/esm/utils/conversation-utils.d.ts +3 -0
- package/dist/esm/utils/conversation-utils.d.ts.map +1 -0
- package/dist/esm/utils/logger.d.ts +12 -0
- package/dist/esm/utils/logger.d.ts.map +1 -0
- package/dist/esm/utils/message-schemas.d.ts +2 -0
- package/dist/esm/utils/message-schemas.d.ts.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015, Jon Schlinkert.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*!
|
|
9
|
+
* strip-bom-string <https://github.com/jonschlinkert/strip-bom-string>
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
|
12
|
+
* Released under the MIT License.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
16
|
+
|
|
17
|
+
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
|
|
18
|
+
|
|
19
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
20
|
+
|
|
21
|
+
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
22
|
+
|
|
23
|
+
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @preserve
|
|
27
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
28
|
+
* All rights reserved. (MIT Licensed)
|
|
29
|
+
*
|
|
30
|
+
* cie94.ts - part of Image Quantization Library
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @preserve
|
|
35
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
36
|
+
* All rights reserved. (MIT Licensed)
|
|
37
|
+
*
|
|
38
|
+
* ciede2000.ts - part of Image Quantization Library
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @preserve
|
|
43
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
44
|
+
* All rights reserved. (MIT Licensed)
|
|
45
|
+
*
|
|
46
|
+
* cmetric.ts - part of Image Quantization Library
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @preserve
|
|
51
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
52
|
+
* All rights reserved. (MIT Licensed)
|
|
53
|
+
*
|
|
54
|
+
* common.ts - part of Image Quantization Library
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @preserve
|
|
59
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
60
|
+
* All rights reserved. (MIT Licensed)
|
|
61
|
+
*
|
|
62
|
+
* constants.ts - part of Image Quantization Library
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @preserve
|
|
67
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
68
|
+
* All rights reserved. (MIT Licensed)
|
|
69
|
+
*
|
|
70
|
+
* ditherErrorDiffusionArray.ts - part of Image Quantization Library
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @preserve
|
|
75
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
76
|
+
* All rights reserved. (MIT Licensed)
|
|
77
|
+
*
|
|
78
|
+
* euclidean.ts - part of Image Quantization Library
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @preserve
|
|
83
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
84
|
+
* All rights reserved. (MIT Licensed)
|
|
85
|
+
*
|
|
86
|
+
* helper.ts - part of Image Quantization Library
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @preserve
|
|
91
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
92
|
+
* All rights reserved. (MIT Licensed)
|
|
93
|
+
*
|
|
94
|
+
* hueStatistics.ts - part of Image Quantization Library
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @preserve
|
|
99
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
100
|
+
* All rights reserved. (MIT Licensed)
|
|
101
|
+
*
|
|
102
|
+
* iq.ts - Image Quantization Library
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @preserve
|
|
107
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
108
|
+
* All rights reserved. (MIT Licensed)
|
|
109
|
+
*
|
|
110
|
+
* lab2rgb.ts - part of Image Quantization Library
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @preserve
|
|
115
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
116
|
+
* All rights reserved. (MIT Licensed)
|
|
117
|
+
*
|
|
118
|
+
* lab2xyz.ts - part of Image Quantization Library
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @preserve
|
|
123
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
124
|
+
* All rights reserved. (MIT Licensed)
|
|
125
|
+
*
|
|
126
|
+
* manhattanNeuQuant.ts - part of Image Quantization Library
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @preserve
|
|
131
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
132
|
+
* All rights reserved. (MIT Licensed)
|
|
133
|
+
*
|
|
134
|
+
* nearestColor.ts - part of Image Quantization Library
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @preserve
|
|
139
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
140
|
+
* All rights reserved. (MIT Licensed)
|
|
141
|
+
*
|
|
142
|
+
* palette.ts - part of Image Quantization Library
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @preserve
|
|
147
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
148
|
+
* All rights reserved. (MIT Licensed)
|
|
149
|
+
*
|
|
150
|
+
* pngQuant.ts - part of Image Quantization Library
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @preserve
|
|
155
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
156
|
+
* All rights reserved. (MIT Licensed)
|
|
157
|
+
*
|
|
158
|
+
* point.ts - part of Image Quantization Library
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @preserve
|
|
163
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
164
|
+
* All rights reserved. (MIT Licensed)
|
|
165
|
+
*
|
|
166
|
+
* pointContainer.ts - part of Image Quantization Library
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @preserve
|
|
171
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
172
|
+
* All rights reserved. (MIT Licensed)
|
|
173
|
+
*
|
|
174
|
+
* rgb2hsl.ts - part of Image Quantization Library
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @preserve
|
|
179
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
180
|
+
* All rights reserved. (MIT Licensed)
|
|
181
|
+
*
|
|
182
|
+
* rgb2lab.ts - part of Image Quantization Library
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @preserve
|
|
187
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
188
|
+
* All rights reserved. (MIT Licensed)
|
|
189
|
+
*
|
|
190
|
+
* rgb2xyz.ts - part of Image Quantization Library
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @preserve
|
|
195
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
196
|
+
* All rights reserved. (MIT Licensed)
|
|
197
|
+
*
|
|
198
|
+
* ssim.ts - part of Image Quantization Library
|
|
199
|
+
*/
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @preserve
|
|
203
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
204
|
+
* All rights reserved. (MIT Licensed)
|
|
205
|
+
*
|
|
206
|
+
* wuQuant.ts - part of Image Quantization Library
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @preserve
|
|
211
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
212
|
+
* All rights reserved. (MIT Licensed)
|
|
213
|
+
*
|
|
214
|
+
* xyz2lab.ts - part of Image Quantization Library
|
|
215
|
+
*/
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @preserve
|
|
219
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
220
|
+
* All rights reserved. (MIT Licensed)
|
|
221
|
+
*
|
|
222
|
+
* xyz2rgb.ts - part of Image Quantization Library
|
|
223
|
+
*/
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @preserve
|
|
227
|
+
* MIT License
|
|
228
|
+
*
|
|
229
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
230
|
+
*
|
|
231
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
232
|
+
* of this software and associated documentation files (the "Software"), to
|
|
233
|
+
* deal in the Software without restriction, including without limitation the
|
|
234
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
235
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
236
|
+
* furnished to do so, subject to the following conditions:
|
|
237
|
+
*
|
|
238
|
+
* The above copyright notice and this permission notice shall be included in
|
|
239
|
+
* all copies or substantial portions of the Software.
|
|
240
|
+
*
|
|
241
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
242
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
243
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
244
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
245
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
246
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
247
|
+
* IN THE SOFTWARE.
|
|
248
|
+
*
|
|
249
|
+
* riemersma.ts - part of Image Quantization Library
|
|
250
|
+
*/
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @preserve TypeScript port:
|
|
254
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
255
|
+
* All rights reserved. (MIT Licensed)
|
|
256
|
+
*
|
|
257
|
+
* colorHistogram.ts - part of Image Quantization Library
|
|
258
|
+
*/
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @preserve TypeScript port:
|
|
262
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
263
|
+
* All rights reserved. (MIT Licensed)
|
|
264
|
+
*
|
|
265
|
+
* neuquant.ts - part of Image Quantization Library
|
|
266
|
+
*/
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @preserve TypeScript port:
|
|
270
|
+
* Copyright 2015-2018 Igor Bezkrovnyi
|
|
271
|
+
* All rights reserved. (MIT Licensed)
|
|
272
|
+
*
|
|
273
|
+
* rgbquant.ts - part of Image Quantization Library
|
|
274
|
+
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RunExecutor } from "./executor-types.js";
|
|
2
|
+
import type { McpServerConfig, SettingSource } from "./options.js";
|
|
3
|
+
export interface LocalExecutorHandle {
|
|
4
|
+
run: RunExecutor;
|
|
5
|
+
reload(): Promise<void>;
|
|
6
|
+
dispose(): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateLocalExecutorOptions {
|
|
9
|
+
readonly workingDirectory?: string;
|
|
10
|
+
readonly apiKey?: string;
|
|
11
|
+
readonly settingSources?: readonly SettingSource[];
|
|
12
|
+
readonly mcpServers?: Record<string, McpServerConfig>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createLocalExecutor(optionsOrWorkingDirectory?: CreateLocalExecutorOptions | string, apiKey?: string): Promise<LocalExecutorHandle>;
|
|
15
|
+
//# sourceMappingURL=local-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-executor.d.ts","sourceRoot":"","sources":["../../src/agent/local-executor.ts"],"names":[],"mappings":"AA0FA,OAAO,KAAK,EACV,WAAW,EAIZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGnE,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,WAAW,CAAC;IACjB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACnD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACvD;AAWD,wBAAsB,mBAAmB,CACvC,yBAAyB,CAAC,EAAE,0BAA0B,GAAG,MAAM,EAC/D,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,CAAC,CAyV9B"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ModelSelection } from "./options.js";
|
|
2
|
+
import type { RunResultStatus } from "./run.js";
|
|
3
|
+
export declare const LOCAL_RUN_STREAM_SCHEMA_VERSION = 1;
|
|
4
|
+
export declare const LOCAL_RUN_STREAM_EVENT_TYPE = "run_stream_event";
|
|
5
|
+
export interface TextBlock {
|
|
6
|
+
type: "text";
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ToolUseBlock {
|
|
10
|
+
type: "tool_use";
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
input: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface SDKSystemMessage {
|
|
16
|
+
type: "system";
|
|
17
|
+
subtype?: "init";
|
|
18
|
+
agent_id: string;
|
|
19
|
+
run_id: string;
|
|
20
|
+
model?: ModelSelection;
|
|
21
|
+
tools?: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface SDKAssistantMessage {
|
|
24
|
+
type: "assistant";
|
|
25
|
+
agent_id: string;
|
|
26
|
+
run_id: string;
|
|
27
|
+
message: {
|
|
28
|
+
role: "assistant";
|
|
29
|
+
content: Array<TextBlock | ToolUseBlock>;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface SDKUserMessageEvent {
|
|
33
|
+
type: "user";
|
|
34
|
+
agent_id: string;
|
|
35
|
+
run_id: string;
|
|
36
|
+
message: {
|
|
37
|
+
role: "user";
|
|
38
|
+
content: TextBlock[];
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface SDKToolUseMessage {
|
|
42
|
+
type: "tool_call";
|
|
43
|
+
agent_id: string;
|
|
44
|
+
run_id: string;
|
|
45
|
+
call_id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
status: "running" | "completed" | "error";
|
|
48
|
+
args?: unknown;
|
|
49
|
+
result?: unknown;
|
|
50
|
+
truncated?: {
|
|
51
|
+
args?: boolean;
|
|
52
|
+
result?: boolean;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface SDKThinkingMessage {
|
|
56
|
+
type: "thinking";
|
|
57
|
+
agent_id: string;
|
|
58
|
+
run_id: string;
|
|
59
|
+
text: string;
|
|
60
|
+
thinking_duration_ms?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface SDKStatusMessage {
|
|
63
|
+
type: "status";
|
|
64
|
+
agent_id: string;
|
|
65
|
+
run_id: string;
|
|
66
|
+
status: "CREATING" | "RUNNING" | "FINISHED" | "ERROR" | "CANCELLED" | "EXPIRED";
|
|
67
|
+
message?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface SDKRequestMessage {
|
|
70
|
+
type: "request";
|
|
71
|
+
agent_id: string;
|
|
72
|
+
run_id: string;
|
|
73
|
+
request_id: string;
|
|
74
|
+
}
|
|
75
|
+
export interface SDKTaskMessage {
|
|
76
|
+
type: "task";
|
|
77
|
+
agent_id: string;
|
|
78
|
+
run_id: string;
|
|
79
|
+
status?: string;
|
|
80
|
+
text?: string;
|
|
81
|
+
}
|
|
82
|
+
export type SDKMessage = SDKSystemMessage | SDKUserMessageEvent | SDKAssistantMessage | SDKToolUseMessage | SDKThinkingMessage | SDKStatusMessage | SDKRequestMessage | SDKTaskMessage;
|
|
83
|
+
export interface LocalRunStreamSdkMessageEvent {
|
|
84
|
+
schemaVersion: typeof LOCAL_RUN_STREAM_SCHEMA_VERSION;
|
|
85
|
+
type: "sdk_message";
|
|
86
|
+
agentId: string;
|
|
87
|
+
runId: string;
|
|
88
|
+
message: SDKMessage;
|
|
89
|
+
}
|
|
90
|
+
export interface LocalRunStreamResultEvent {
|
|
91
|
+
schemaVersion: typeof LOCAL_RUN_STREAM_SCHEMA_VERSION;
|
|
92
|
+
type: "result";
|
|
93
|
+
agentId: string;
|
|
94
|
+
runId: string;
|
|
95
|
+
status: RunResultStatus;
|
|
96
|
+
errorCode?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface LocalRunStreamDoneEvent {
|
|
99
|
+
schemaVersion: typeof LOCAL_RUN_STREAM_SCHEMA_VERSION;
|
|
100
|
+
type: "done";
|
|
101
|
+
agentId: string;
|
|
102
|
+
runId: string;
|
|
103
|
+
}
|
|
104
|
+
export type LocalRunStreamEvent = LocalRunStreamSdkMessageEvent | LocalRunStreamResultEvent | LocalRunStreamDoneEvent;
|
|
105
|
+
export declare function createSdkMessageRunStreamEvent(message: SDKMessage): LocalRunStreamSdkMessageEvent;
|
|
106
|
+
export declare function decodeLocalRunStreamEvent(payload: unknown): LocalRunStreamEvent;
|
|
107
|
+
export declare function localRunStreamEventToSdkMessage(event: LocalRunStreamEvent): SDKMessage | undefined;
|
|
108
|
+
export declare function decodeSdkMessageRunStreamEvent(payload: unknown): SDKMessage;
|
|
109
|
+
export declare function isTerminalLocalRunStreamEvent(event: LocalRunStreamEvent): boolean;
|
|
110
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/agent/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,eAAO,MAAM,+BAA+B,IAAI,CAAC;AACjD,eAAO,MAAM,2BAA2B,qBAAqB,CAAC;AAE9D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,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E,OAAO,+BAA+B,CAAC;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,mBAAmB,GAC3B,6BAA6B,GAC7B,yBAAyB,GACzB,uBAAuB,CAAC;AAE5B,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,UAAU,GAClB,6BAA6B,CAQ/B;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,GACf,mBAAmB,CAwBrB;AAED,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,mBAAmB,GACzB,UAAU,GAAG,SAAS,CAExB;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAS3E;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAKT"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { CursorAgentPlatformOptions } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
2
|
+
export interface SDKImageDimension {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
export type SDKImage = {
|
|
7
|
+
url: string;
|
|
8
|
+
dimension?: SDKImageDimension;
|
|
9
|
+
} | {
|
|
10
|
+
data: string;
|
|
11
|
+
mimeType: string;
|
|
12
|
+
dimension?: SDKImageDimension;
|
|
13
|
+
};
|
|
14
|
+
export interface SDKUserMessage {
|
|
15
|
+
text: string;
|
|
16
|
+
images?: SDKImage[];
|
|
17
|
+
}
|
|
18
|
+
export type McpServerConfig = {
|
|
19
|
+
type?: "stdio";
|
|
20
|
+
command: string;
|
|
21
|
+
args?: string[];
|
|
22
|
+
env?: Record<string, string>;
|
|
23
|
+
cwd?: string;
|
|
24
|
+
} | {
|
|
25
|
+
type?: "http" | "sse";
|
|
26
|
+
url: string;
|
|
27
|
+
headers?: Record<string, string>;
|
|
28
|
+
auth?: {
|
|
29
|
+
CLIENT_ID: string;
|
|
30
|
+
CLIENT_SECRET?: string;
|
|
31
|
+
scopes?: string[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type SettingSource = "project" | "user" | "team" | "mdm" | "plugins" | "all";
|
|
35
|
+
export interface ModelParameterValue {
|
|
36
|
+
id: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ModelSelection {
|
|
40
|
+
id: string;
|
|
41
|
+
params?: ModelParameterValue[];
|
|
42
|
+
}
|
|
43
|
+
export interface ModelParameterDefinition {
|
|
44
|
+
id: string;
|
|
45
|
+
displayName?: string;
|
|
46
|
+
values: Array<{
|
|
47
|
+
value: string;
|
|
48
|
+
displayName?: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
export interface ModelVariant {
|
|
52
|
+
params: ModelParameterValue[];
|
|
53
|
+
displayName: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
isDefault?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface ModelListItem {
|
|
58
|
+
id: string;
|
|
59
|
+
displayName: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
parameters?: ModelParameterDefinition[];
|
|
62
|
+
variants?: ModelVariant[];
|
|
63
|
+
}
|
|
64
|
+
export interface AgentDefinition {
|
|
65
|
+
description: string;
|
|
66
|
+
prompt: string;
|
|
67
|
+
model?: ModelSelection | "inherit";
|
|
68
|
+
mcpServers?: Array<string | Record<string, McpServerConfig>>;
|
|
69
|
+
}
|
|
70
|
+
export interface AgentOptions {
|
|
71
|
+
/**
|
|
72
|
+
* Model selection (`{ id, params? }`). Required for local agents; optional
|
|
73
|
+
* for cloud (the server resolves the caller's configured default when
|
|
74
|
+
* omitted). Use `Cursor.models.list()` to discover valid selections.
|
|
75
|
+
*/
|
|
76
|
+
model?: ModelSelection;
|
|
77
|
+
apiKey?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Optional human-readable name for the agent, surfaced as the `title` in
|
|
80
|
+
* `Agent.list()` / `Agent.get()`. Cloud agents auto-generate a name from
|
|
81
|
+
* the first prompt when this is omitted; local agents fall back to a
|
|
82
|
+
* generic default.
|
|
83
|
+
*/
|
|
84
|
+
name?: string;
|
|
85
|
+
local?: {
|
|
86
|
+
cwd?: string | string[];
|
|
87
|
+
envVars?: Record<string, string>;
|
|
88
|
+
/**
|
|
89
|
+
* Ambient Cursor settings layers to load from the local filesystem.
|
|
90
|
+
* Local agents only. On cloud, `project` / `team` / `plugins` are
|
|
91
|
+
* always on and `user` / `mdm` / `local` have no VM equivalent, so
|
|
92
|
+
* this field is gated to the local shape.
|
|
93
|
+
*/
|
|
94
|
+
settingSources?: SettingSource[];
|
|
95
|
+
};
|
|
96
|
+
cloud?: {
|
|
97
|
+
env?: {
|
|
98
|
+
type: "cloud";
|
|
99
|
+
name?: string;
|
|
100
|
+
} | {
|
|
101
|
+
type: "pool";
|
|
102
|
+
name?: string;
|
|
103
|
+
} | {
|
|
104
|
+
type: "machine";
|
|
105
|
+
name?: string;
|
|
106
|
+
};
|
|
107
|
+
repos?: Array<{
|
|
108
|
+
url: string;
|
|
109
|
+
startingRef?: string;
|
|
110
|
+
prUrl?: string;
|
|
111
|
+
}>;
|
|
112
|
+
workOnCurrentBranch?: boolean;
|
|
113
|
+
autoCreatePR?: boolean;
|
|
114
|
+
skipReviewerRequest?: boolean;
|
|
115
|
+
};
|
|
116
|
+
mcpServers?: Record<string, McpServerConfig>;
|
|
117
|
+
agents?: Record<string, AgentDefinition>;
|
|
118
|
+
agentId?: string;
|
|
119
|
+
resume?: string;
|
|
120
|
+
platform?: CursorAgentPlatformOptions;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/agent/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAEhG,MAAM,WAAW,iBA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AG,CAAC,EACA;YAAE,IAAI,EAAE,OAAO,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,GAChC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,GAC/B;YAAE,IAAI,EAAE,SAAS,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACvC,KAAK,CAAC,EAAE,KAAK,CAAC;YACZ,GAAG,EAAE,MAAM,CAAC;YACZ,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,CAAC,CAAC;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,0BAA0B,CAAC;CACvC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AgentCheckpointStore, AgentRunStore, CursorAgentPlatformOptions, RunEventNotifier, RunEventStore } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
2
|
+
import type { AgentMessage, AgentOperationOptions, CursorRequestOptions, GetAgentMessagesOptions, GetAgentOptions, GetRunOptions, ListAgentsOptions, ListRunsOptions, ListResult as PublicListResult, SDKAgent, SDKAgentInfo, SDKModel, SDKRepository, SDKUser } from "./agent.js";
|
|
3
|
+
import { type SDKMessage } from "./messages.js";
|
|
4
|
+
import type { AgentOptions } from "./options.js";
|
|
5
|
+
import { type Run } from "./run.js";
|
|
6
|
+
export declare class CursorAgentPlatform {
|
|
7
|
+
readonly store: AgentRunStore;
|
|
8
|
+
readonly checkpointStore: AgentCheckpointStore;
|
|
9
|
+
readonly eventStore: RunEventStore | undefined;
|
|
10
|
+
readonly eventNotifier: RunEventNotifier | undefined;
|
|
11
|
+
private readonly workspaceRef;
|
|
12
|
+
constructor(store: AgentRunStore, checkpointStore: AgentCheckpointStore, eventStore: RunEventStore | undefined, eventNotifier: RunEventNotifier | undefined, workspaceRef: string);
|
|
13
|
+
createAgent(options: AgentOptions): Promise<SDKAgent>;
|
|
14
|
+
resumeAgent(agentId: string, options: Partial<AgentOptions>): Promise<SDKAgent>;
|
|
15
|
+
listAgents(options?: ListAgentsOptions): Promise<PublicListResult<SDKAgentInfo>>;
|
|
16
|
+
getAgent(agentId: string): Promise<SDKAgentInfo>;
|
|
17
|
+
archiveAgent(agentId: string): Promise<void>;
|
|
18
|
+
unarchiveAgent(agentId: string): Promise<void>;
|
|
19
|
+
deleteAgent(agentId: string): Promise<void>;
|
|
20
|
+
listRuns(agentId: string, options?: ListRunsOptions): Promise<PublicListResult<Run>>;
|
|
21
|
+
getRun(runId: string): Promise<Run>;
|
|
22
|
+
getAgentMessages(agentId: string, options?: GetAgentMessagesOptions): Promise<AgentMessage[]>;
|
|
23
|
+
appendRunMessage(message: SDKMessage): Promise<void>;
|
|
24
|
+
private toDetachedStoreRun;
|
|
25
|
+
private createRunEventTailer;
|
|
26
|
+
private findRunById;
|
|
27
|
+
}
|
|
28
|
+
export declare function createAgentPlatform(options?: CursorAgentPlatformOptions): Promise<CursorAgentPlatform>;
|
|
29
|
+
export declare function createDefaultAgent(options: AgentOptions): Promise<SDKAgent>;
|
|
30
|
+
export declare function resumeDefaultAgent(agentId: string, options?: Partial<AgentOptions>): Promise<SDKAgent>;
|
|
31
|
+
export declare function listDefaultAgents(options?: ListAgentsOptions): Promise<PublicListResult<SDKAgentInfo>>;
|
|
32
|
+
export declare function listDefaultRuns(agentId: string, options?: ListRunsOptions): Promise<PublicListResult<Run>>;
|
|
33
|
+
export declare function getDefaultRun(runId: string, options?: GetRunOptions): Promise<Run>;
|
|
34
|
+
export declare function getDefaultAgentMessages(agentId: string, options?: GetAgentMessagesOptions): Promise<AgentMessage[]>;
|
|
35
|
+
export declare function getDefaultAgent(agentId: string, options?: GetAgentOptions): Promise<SDKAgentInfo>;
|
|
36
|
+
export declare function archiveDefaultAgent(agentId: string, options?: AgentOperationOptions): Promise<void>;
|
|
37
|
+
export declare function unarchiveDefaultAgent(agentId: string, options?: AgentOperationOptions): Promise<void>;
|
|
38
|
+
export declare function deleteDefaultAgent(agentId: string, options?: AgentOperationOptions): Promise<void>;
|
|
39
|
+
export declare function getDefaultMe(options?: CursorRequestOptions): Promise<SDKUser>;
|
|
40
|
+
export declare function listDefaultModels(options?: CursorRequestOptions): Promise<SDKModel[]>;
|
|
41
|
+
export declare function listDefaultRepositories(options?: CursorRequestOptions): Promise<SDKRepository[]>;
|
|
42
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/agent/platform.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EAEpB,aAAa,EACb,0BAA0B,EAC1B,gBAAgB,EAChB,aAAa,EAId,MAAM,+CAA+C,CAAC;AAIvD,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,UAAU,IAAI,gBAAgB,EAC9B,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,OAAO,EAER,MAAM,YAAY,CAAC;AASpB,OAAO,EAGL,KAAK,UAAU,EAGhB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,YAAY,EAGb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,GAAG,EAKT,MAAM,UAAU,CAAC;AAopBlB,qBAAa,mBAAmB;IAE5B,Q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;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,wBAAsB,iBAAiB,CACrC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,QAAQ,EAAE,CAAC,CAGrB;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,aAAa,EAAE,CAAC,CAG1B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { AgentCheckpointStore, AgentLifecycleStatus, AgentRecord, AgentRunStore, AppendRunEventInput, AttachRunEventsInput, CheckpointRef, CreateAgentInput, CreateFollowUpRunInput, CursorAgentPlatformOptions, ListRunEventsInput, ListRunEventsResult, LocalRunEventNotifierOptions, LocalRunEventNotifierServerOptions, RunEventHint, RunEventNotifier, RunEventOffset, RunEventRecord, RunEventStore, RunEventStreamStore, RunEventSubscription, RunLifecycleStatus, RunRecord, RunTerminalPatch, WatchableRunEventStore, WatchRunEventsInput, } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
2
|
+
export { createInMemoryRunEventNotifier, createLocalRunEventNotifier, InMemoryRunEventNotifier, LocalRunEventNotifier, LocalRunEventNotifierServer, startLocalRunEventNotifierServer, } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
3
|
+
export type { AgentMessage, AgentOperationOptions, CursorRequestOptions, GetAgentMessagesOptions, GetAgentOptions, GetRunOptions, ListAgentsOptions, ListResult, ListRunsOptions, SDKAgent, SDKAgentInfo, SDKModel, SDKRepository, SDKUser, SendOptions, } from "./agent.js";
|
|
4
|
+
export type { SDKArtifact } from "./artifacts.js";
|
|
5
|
+
export type { LocalRunStreamDoneEvent, LocalRunStreamEvent, LocalRunStreamResultEvent, LocalRunStreamSdkMessageEvent, SDKAssistantMessage, SDKMessage, SDKStatusMessage, SDKSystemMessage, SDKTaskMessage, SDKThinkingMessage, SDKToolUseMessage, SDKUserMessageEvent, TextBlock, ToolUseBlock, } from "./messages.js";
|
|
6
|
+
export { createSdkMessageRunStreamEvent, decodeLocalRunStreamEvent, decodeSdkMessageRunStreamEvent, isTerminalLocalRunStreamEvent, LOCAL_RUN_STREAM_EVENT_TYPE, LOCAL_RUN_STREAM_SCHEMA_VERSION, localRunStreamEventToSdkMessage, } from "./messages.js";
|
|
7
|
+
export type { AgentDefinition, AgentOptions, McpServerConfig, ModelListItem, ModelParameterDefinition, ModelParameterValue, ModelSelection, ModelVariant, SDKImage, SDKImageDimension, SDKUserMessage, SettingSource, } from "./options.js";
|
|
8
|
+
export { CursorAgentPlatform, createAgentPlatform } from "./platform.js";
|
|
9
|
+
export type { Run, RunOperation, RunResult, RunResultStatus, RunStatus, } from "./run.js";
|
|
10
|
+
export { UnsupportedRunOperationError } from "./run.js";
|
|
11
|
+
export { Agent, Cursor } from "./stubs.js";
|
|
12
|
+
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../src/agent/public-api.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,kCAAkC,EAClC,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EA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ventStore, RunEventStreamStore, RunLifecycleStatus } from "@anysphere/cursor-sdk-local-runtime/run-store";
|
|
2
|
+
import { type SDKMessage } from "./messages.js";
|
|
3
|
+
export interface RunEventTailerStreamOptions {
|
|
4
|
+
afterOffset?: RunEventOffset;
|
|
5
|
+
limit?: number;
|
|
6
|
+
mode?: "replay" | "tail" | "replay-and-tail";
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
pollIntervalMs?: number;
|
|
9
|
+
}
|
|
10
|
+
interface RunEventTailerOptions {
|
|
11
|
+
eventStore: RunEventStore;
|
|
12
|
+
eventStreamStore?: RunEventStreamStore;
|
|
13
|
+
eventNotifier?: RunEventNotifier;
|
|
14
|
+
loadRunStatus(runId: string): Promise<RunLifecycleStatus | undefined>;
|
|
15
|
+
defaultPollIntervalMs?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class RunEventTailer {
|
|
18
|
+
private readonly eventStore;
|
|
19
|
+
private readonly eventStreamStore;
|
|
20
|
+
private readonly eventNotifier;
|
|
21
|
+
private readonly loadRunStatus;
|
|
22
|
+
private readonly defaultPollIntervalMs;
|
|
23
|
+
constructor(options: RunEventTailerOptions);
|
|
24
|
+
streamRunEvents(runId: string, options?: RunEventTailerStreamOptions): AsyncGenerator<SDKMessage, void>;
|
|
25
|
+
private streamAttachedRunEvents;
|
|
26
|
+
private streamPolledRunEvents;
|
|
27
|
+
private drainExistingEvents;
|
|
28
|
+
private listAvailableEvents;
|
|
29
|
+
private decodeRunEventRecord;
|
|
30
|
+
private isTerminalAndDrained;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=run-event-tailer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-event-tailer.d.ts","sourceRoot":"","sources":["../../src/agent/run-event-tailer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EAEd,aAAa,EACb,mBAAmB,EAEnB,kBAAkB,EACnB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