@meetopenbot/cursor 0.0.6 → 1.0.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/session.js +1 -1
- package/dist/state.js +6 -2
- package/package.json +2 -2
package/dist/session.js
CHANGED
|
@@ -8,7 +8,7 @@ export class StaleAgentSessionError extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
const sessionCache = new Map();
|
|
11
|
-
const buildSessionKey = (state) => state.threadId ? `${state.channelId}:${state.threadId}` : state.channelId;
|
|
11
|
+
const buildSessionKey = (state) => state.threadId ? `${state.channelId ?? ''}:${state.threadId}` : (state.channelId ?? '');
|
|
12
12
|
const buildAgentOptions = (config) => {
|
|
13
13
|
const options = {
|
|
14
14
|
apiKey: config.apiKey,
|
package/dist/state.js
CHANGED
|
@@ -9,13 +9,17 @@ export const readPersistedState = (state) => {
|
|
|
9
9
|
: {};
|
|
10
10
|
};
|
|
11
11
|
export const persistCursorState = async (state, storage, patch) => {
|
|
12
|
+
const channelId = state.channelId;
|
|
13
|
+
if (!channelId) {
|
|
14
|
+
throw new Error('channelId is required to persist Cursor session state');
|
|
15
|
+
}
|
|
12
16
|
if (state.threadId) {
|
|
13
17
|
await storage.patchThreadState({
|
|
14
|
-
channelId
|
|
18
|
+
channelId,
|
|
15
19
|
threadId: state.threadId,
|
|
16
20
|
state: patch,
|
|
17
21
|
});
|
|
18
22
|
return;
|
|
19
23
|
}
|
|
20
|
-
await storage.patchChannelState({ channelId
|
|
24
|
+
await storage.patchChannelState({ channelId, state: patch });
|
|
21
25
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meetopenbot/cursor",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
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": "^1.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^25.9.2",
|