@meetopenbot/cursor 0.0.5 → 0.0.6
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/stream.js +16 -4
- package/package.json +2 -2
package/dist/stream.js
CHANGED
|
@@ -14,18 +14,30 @@ export const classifyCursorEvent = (event) => {
|
|
|
14
14
|
const text = assistantText(event);
|
|
15
15
|
return text ? { type: 'delta', text } : { type: 'skip' };
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
if (event.type === 'tool_call') {
|
|
18
|
+
if (event.status === 'running') {
|
|
19
|
+
return { type: 'tool_call', id: event.call_id, name: event.name, input: event.args };
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
type: 'tool_result',
|
|
23
|
+
id: event.call_id,
|
|
24
|
+
name: event.name,
|
|
25
|
+
input: event.args,
|
|
26
|
+
output: event.result,
|
|
27
|
+
error: event.status === 'error',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (event.type === 'usage')
|
|
19
31
|
return { type: 'flush' };
|
|
20
32
|
return { type: 'skip' };
|
|
21
33
|
};
|
|
22
|
-
/** Run a Cursor prompt and yield each completed assistant turn. */
|
|
34
|
+
/** Run a Cursor prompt and yield each completed assistant turn and tool widget. */
|
|
23
35
|
export async function* runCursorPrompt(agent, prompt, config, wasResumed) {
|
|
24
36
|
const run = await agent.send(prompt, {
|
|
25
37
|
...(config.mode ? { mode: config.mode } : {}),
|
|
26
38
|
model: buildModelSelection(config),
|
|
27
39
|
});
|
|
28
|
-
yield* emitTextReplies(run.stream(), classifyCursorEvent);
|
|
40
|
+
yield* emitTextReplies(run.stream(), classifyCursorEvent, { groupId: 'cursor:tools' });
|
|
29
41
|
const result = await run.wait();
|
|
30
42
|
if (result.status === 'error') {
|
|
31
43
|
if (wasResumed && (result.durationMs ?? 0) < 2000) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meetopenbot/cursor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "OpenBot agent plugin powered by the Cursor SDK.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@cursor/sdk": "^1.0.18",
|
|
23
|
-
"@meetopenbot/plugin-sdk": "^0.
|
|
23
|
+
"@meetopenbot/plugin-sdk": "^0.5.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^25.9.2",
|