@eduardo191labs/opencode-free-pi 0.7.35 → 0.7.36
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/plugin.js +5 -1
- package/dist/session/hooks.js +3 -3
- package/dist/session/wire.d.ts +2 -1
- package/dist/session/wire.js +2 -1
- package/package.json +1 -1
- package/src/plugin.ts +5 -1
- package/src/session/hooks.ts +3 -3
- package/src/session/wire.ts +2 -1
package/dist/plugin.js
CHANGED
|
@@ -182,7 +182,9 @@ async function setup(ctx) {
|
|
|
182
182
|
registrations.push(await tool.register());
|
|
183
183
|
}
|
|
184
184
|
catch (error) {
|
|
185
|
-
log.warn(`Could not register the ${tool.name} tools`,
|
|
185
|
+
log.warn(`Could not register the ${tool.name} tools`, {
|
|
186
|
+
error: error instanceof Error ? error.message : String(error),
|
|
187
|
+
});
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
190
|
const abort = new AbortController();
|
|
@@ -200,6 +202,8 @@ async function setup(ctx) {
|
|
|
200
202
|
resolve();
|
|
201
203
|
};
|
|
202
204
|
const timer = setTimeout(finish, ms);
|
|
205
|
+
// The recovery wait must never be the reason the process stays alive.
|
|
206
|
+
timer.unref?.();
|
|
203
207
|
abort.signal.addEventListener("abort", finish, { once: true });
|
|
204
208
|
});
|
|
205
209
|
const catalogRecovery = (async () => {
|
package/dist/session/hooks.js
CHANGED
|
@@ -208,9 +208,9 @@ async function hookForProviders(ctx, name, callback, registrations) {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
|
-
* Handles every free-pi HTTP response:
|
|
212
|
-
*
|
|
213
|
-
*
|
|
211
|
+
* Handles every free-pi HTTP response: rewrites context overflows into
|
|
212
|
+
* something OpenCode compacts on, turns long-lived limits into readable
|
|
213
|
+
* messages and watches for server notices.
|
|
214
214
|
*
|
|
215
215
|
* Split from `registerSessionHooks` because the response path is the plugin's
|
|
216
216
|
* most intricate logic and it was buried mid-function.
|
package/dist/session/wire.d.ts
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* The mapping is also stored in plugin storage, which is how an OpenCode
|
|
11
11
|
* session reopened after a restart reconnects to the same provider session
|
|
12
12
|
* instead of starting a new one. If that old id turns out to be locked, the
|
|
13
|
-
*
|
|
13
|
+
* request fails with `429 concurrent` and OpenCode's retry finds the session
|
|
14
|
+
* marked dirty, which rotates the id before the next attempt.
|
|
14
15
|
*/
|
|
15
16
|
import type { Deps } from "../deps.js";
|
|
16
17
|
export declare function wireSessionID(deps: Deps, sessionID: string): string;
|
package/dist/session/wire.js
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* The mapping is also stored in plugin storage, which is how an OpenCode
|
|
11
11
|
* session reopened after a restart reconnects to the same provider session
|
|
12
12
|
* instead of starting a new one. If that old id turns out to be locked, the
|
|
13
|
-
*
|
|
13
|
+
* request fails with `429 concurrent` and OpenCode's retry finds the session
|
|
14
|
+
* marked dirty, which rotates the id before the next attempt.
|
|
14
15
|
*/
|
|
15
16
|
import { trimSet } from "../utils/async.js";
|
|
16
17
|
const DIRTY_LIMIT = 256;
|
package/package.json
CHANGED
package/src/plugin.ts
CHANGED
|
@@ -226,7 +226,9 @@ async function setup(ctx: Plugin.Context): Promise<() => Promise<void>> {
|
|
|
226
226
|
try {
|
|
227
227
|
registrations.push(await tool.register());
|
|
228
228
|
} catch (error) {
|
|
229
|
-
log.warn(`Could not register the ${tool.name} tools`,
|
|
229
|
+
log.warn(`Could not register the ${tool.name} tools`, {
|
|
230
|
+
error: error instanceof Error ? error.message : String(error),
|
|
231
|
+
});
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
234
|
const abort = new AbortController();
|
|
@@ -245,6 +247,8 @@ async function setup(ctx: Plugin.Context): Promise<() => Promise<void>> {
|
|
|
245
247
|
resolve();
|
|
246
248
|
};
|
|
247
249
|
const timer = setTimeout(finish, ms);
|
|
250
|
+
// The recovery wait must never be the reason the process stays alive.
|
|
251
|
+
(timer as { unref?: () => void }).unref?.();
|
|
248
252
|
abort.signal.addEventListener("abort", finish, { once: true });
|
|
249
253
|
});
|
|
250
254
|
const catalogRecovery = (async () => {
|
package/src/session/hooks.ts
CHANGED
|
@@ -295,9 +295,9 @@ async function hookForProviders(
|
|
|
295
295
|
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
|
-
* Handles every free-pi HTTP response:
|
|
299
|
-
*
|
|
300
|
-
*
|
|
298
|
+
* Handles every free-pi HTTP response: rewrites context overflows into
|
|
299
|
+
* something OpenCode compacts on, turns long-lived limits into readable
|
|
300
|
+
* messages and watches for server notices.
|
|
301
301
|
*
|
|
302
302
|
* Split from `registerSessionHooks` because the response path is the plugin's
|
|
303
303
|
* most intricate logic and it was buried mid-function.
|
package/src/session/wire.ts
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* The mapping is also stored in plugin storage, which is how an OpenCode
|
|
11
11
|
* session reopened after a restart reconnects to the same provider session
|
|
12
12
|
* instead of starting a new one. If that old id turns out to be locked, the
|
|
13
|
-
*
|
|
13
|
+
* request fails with `429 concurrent` and OpenCode's retry finds the session
|
|
14
|
+
* marked dirty, which rotates the id before the next attempt.
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
import type { Deps } from "../deps.js";
|