opencode-sync-plugin 0.3.5 → 0.3.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/README.md +1 -1
- package/dist/index.js +18 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Sync your OpenCode sessions to the cloud. Search, share, and access your coding
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/opencode-sync-plugin)
|
|
6
6
|
|
|
7
|
-
## OpenSync Ecosystem
|
|
7
|
+
## OpenSync Ecosystem
|
|
8
8
|
|
|
9
9
|
| Package | Description | Links |
|
|
10
10
|
|---------|-------------|-------|
|
package/dist/index.js
CHANGED
|
@@ -202,39 +202,26 @@ var OpenCodeSyncPlugin = async ({ client }) => {
|
|
|
202
202
|
syncedSessions.add(sessionId);
|
|
203
203
|
}
|
|
204
204
|
if (event.type === "session.idle") {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
if (client) {
|
|
222
|
-
try {
|
|
223
|
-
const response = await client.session.get({
|
|
224
|
-
path: { id: sessionId }
|
|
205
|
+
setTimeout(() => {
|
|
206
|
+
const localData = getLocalSessionData(sessionId);
|
|
207
|
+
if (localData && (localData.title || localData.slug)) {
|
|
208
|
+
doSyncSession({
|
|
209
|
+
...props,
|
|
210
|
+
title: localData.title || props?.title,
|
|
211
|
+
slug: localData.slug || props?.slug,
|
|
212
|
+
modelID: localData.model || props?.modelID,
|
|
213
|
+
providerID: localData.provider || props?.providerID,
|
|
214
|
+
tokens: {
|
|
215
|
+
input: localData.promptTokens || 0,
|
|
216
|
+
output: localData.completionTokens || 0
|
|
217
|
+
},
|
|
218
|
+
cost: localData.cost || 0
|
|
225
219
|
});
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
doSyncSession({
|
|
229
|
-
...props,
|
|
230
|
-
title: sessionData.title,
|
|
231
|
-
slug: sessionData.slug
|
|
232
|
-
});
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
} catch {
|
|
220
|
+
} else {
|
|
221
|
+
doSyncSession(props);
|
|
236
222
|
}
|
|
237
|
-
}
|
|
223
|
+
}, 1e3);
|
|
224
|
+
return;
|
|
238
225
|
}
|
|
239
226
|
doSyncSession(props);
|
|
240
227
|
}
|