Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/integration/assets/opencode/herdr-agent-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,33 @@
server: HerdrAgentStatePlugin,
setup() {},
};

// opencode2 compatibility: plugin loader expects a default export definition
// with an id and setup/effect function.
export default {
id: "herdr-agent-state",
async setup(ctx) {
const handlers = await HerdrAgentStatePlugin();

if (!ctx || typeof ctx.on !== "function") {
// Fail softly if host API shape differs.
return;
}

const disposers = [];

if (typeof handlers?.["chat.message"] === "function") {
disposers.push(ctx.on("chat.message", handlers["chat.message"]));
}

if (typeof handlers?.event === "function") {
disposers.push(ctx.on("event", handlers.event));
}

return () => {
for (const dispose of disposers) {
if (typeof dispose === "function") dispose();
}
};
},
};

Check failure on line 240 in src/integration/assets/opencode/herdr-agent-state.js

View workflow job for this annotation

GitHub Actions / check (ubuntu-latest)

SyntaxError: Only one 'default' export is allowed.

at <parse> (/home/runner/work/herdr/herdr/src/integration/assets/opencode/herdr-agent-state.js:240:1) at processTicksAndRejections (native:7:39)

Check failure on line 240 in src/integration/assets/opencode/herdr-agent-state.js

View workflow job for this annotation

GitHub Actions / check (macos-latest)

SyntaxError: Only one 'default' export is allowed.

at <parse> (/Users/runner/work/herdr/herdr/src/integration/assets/opencode/herdr-agent-state.js:240:1) at processTicksAndRejections (native:7:39)
Loading