oh-my-opencode-cohub 1.5.1 → 1.5.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAqIlD,QAAA,MAAM,WAAW,EAAE,MA8ZlB,CAAC;AAEF,eAAO,MAAM,MAAM,QAAc,CAAC;AAClC,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAqIlD,QAAA,MAAM,WAAW,EAAE,MAualB,CAAC;AAEF,eAAO,MAAM,MAAM,QAAc,CAAC;AAClC,eAAe,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -1764,8 +1764,19 @@ var CoHubPlugin = async (input, options) => {
1764
1764
  if (details) {
1765
1765
  output.args[targetField] += details;
1766
1766
  }
1767
+ const logPath = path2.join(os2.tmpdir(), "opencode", "ctx-diag.log");
1768
+ try {
1769
+ const stat = fs2.statSync(logPath);
1770
+ if (stat.size > 50 * 1024) {
1771
+ const lines = fs2.readFileSync(logPath, "utf-8").trim().split(`
1772
+ `);
1773
+ fs2.writeFileSync(logPath, lines.slice(-30).join(`
1774
+ `) + `
1775
+ `);
1776
+ }
1777
+ } catch {}
1767
1778
  const finalPrompt = typeof output.args?.prompt === "string" ? output.args.prompt : "";
1768
- fs2.appendFileSync(path2.join(os2.tmpdir(), "opencode", "ctx-diag.log"), JSON.stringify({
1779
+ fs2.appendFileSync(logPath, JSON.stringify({
1769
1780
  time: new Date().toISOString(),
1770
1781
  session: input2.sessionID?.slice(0, 20) ?? "?",
1771
1782
  subagent: subagentType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-cohub",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Mr-cjf/oh-my-opencode-cohub.git"