opencode-immune 1.0.58 → 1.0.59
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 +9 -2
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// .opencode/plugin.ts — opencode-immune plugin
|
|
2
2
|
// Hybrid single-file architecture with factory functions, explicit state, error boundaries
|
|
3
3
|
// See: memory-bank/creative/creative-plugin-architecture.md (Option C)
|
|
4
|
-
import { createOpencodeClient as createOpencodeClientV2 } from "@opencode-ai/sdk/v2
|
|
4
|
+
import { createOpencodeClient as createOpencodeClientV2 } from "@opencode-ai/sdk/v2";
|
|
5
5
|
import { appendFile, mkdir, readFile, unlink, writeFile, stat, rm, rename, readdir, copyFile } from "fs/promises";
|
|
6
6
|
import { join, dirname } from "path";
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
@@ -11,7 +11,7 @@ import { execFile } from "child_process";
|
|
|
11
11
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
12
12
|
// PLUGIN VERSION CHECK
|
|
13
13
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
14
|
-
const PLUGIN_VERSION = "1.0.
|
|
14
|
+
const PLUGIN_VERSION = "1.0.59";
|
|
15
15
|
const PLUGIN_PACKAGE_NAME = "opencode-immune";
|
|
16
16
|
const PLUGIN_DIRNAME = dirname(fileURLToPath(import.meta.url));
|
|
17
17
|
function getServerAuthHeaders() {
|
|
@@ -1681,6 +1681,13 @@ function createEventHandler(state) {
|
|
|
1681
1681
|
const info = event.properties?.info;
|
|
1682
1682
|
const sessionID = event.properties?.sessionID ?? info?.id;
|
|
1683
1683
|
const error = event.properties?.error;
|
|
1684
|
+
if (eventType === "session.error") {
|
|
1685
|
+
await writeDiagnosticLog(state, "session-error:observed", {
|
|
1686
|
+
sessionID,
|
|
1687
|
+
action: getManagedSessionErrorAction(error),
|
|
1688
|
+
errorType: getRetryableErrorType(error),
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1684
1691
|
// Fallback: some SDK/schema errors can arrive without a valid sessionID
|
|
1685
1692
|
// (for example: "Expected 'id' to be a string."). If there is exactly one
|
|
1686
1693
|
// active managed root session, retry it as a best-effort recovery path.
|