opencode-auto-resume 1.0.13 → 1.0.14
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/index.js +7 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12512,7 +12512,11 @@ var AutoResumePlugin = async (ctx, options) => {
|
|
|
12512
12512
|
}
|
|
12513
12513
|
function getSid(ev) {
|
|
12514
12514
|
const props = ev.properties;
|
|
12515
|
-
|
|
12515
|
+
const sid = ev.sessionID ?? props?.sessionID ?? props?.part?.sessionID ?? props?.info?.sessionID;
|
|
12516
|
+
if (sid && typeof sid === "string" && sid.startsWith("ses_")) {
|
|
12517
|
+
return sid;
|
|
12518
|
+
}
|
|
12519
|
+
return;
|
|
12516
12520
|
}
|
|
12517
12521
|
function getError(ev) {
|
|
12518
12522
|
const props = ev.properties;
|
|
@@ -12868,7 +12872,7 @@ var AutoResumePlugin = async (ctx, options) => {
|
|
|
12868
12872
|
const idleSec = Math.round((Date.now() - (w.orphanWatchStartAt ?? w.lastActivityAt)) / 1000);
|
|
12869
12873
|
await log("info", `Abort+Resume on ${short(sid)} (${idleSec}s idle). Aborting...`);
|
|
12870
12874
|
try {
|
|
12871
|
-
await ctx.client.session.abort({
|
|
12875
|
+
await ctx.client.session.abort({ path: { id: sid } });
|
|
12872
12876
|
await log("info", `${short(sid)} - abort OK`);
|
|
12873
12877
|
} catch (err) {
|
|
12874
12878
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
@@ -12927,7 +12931,7 @@ var AutoResumePlugin = async (ctx, options) => {
|
|
|
12927
12931
|
const list = extractMessages(response);
|
|
12928
12932
|
for (const s of list) {
|
|
12929
12933
|
const sid = s.id;
|
|
12930
|
-
if (sid) {
|
|
12934
|
+
if (sid && typeof sid === "string" && sid.startsWith("ses_")) {
|
|
12931
12935
|
const isNew = !sessions.has(sid);
|
|
12932
12936
|
ensureWatch(sid);
|
|
12933
12937
|
const status = s.status;
|
package/package.json
CHANGED