oh-my-opencode-cohub 1.2.0 → 1.2.1

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;AAyClD,wBAAwB;AACxB,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAalD,CAAC;AAwEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,wrBAA+B,CAAC;AAEhE,QAAA,MAAM,WAAW,EAAE,MAgXlB,CAAC;AAEF,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;AAyClD,wBAAwB;AACxB,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAalD,CAAC;AAwEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,wrBAA+B,CAAC;AAEhE,QAAA,MAAM,WAAW,EAAE,MA2XlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -1570,10 +1570,15 @@ var CoHubPlugin = async (input, options) => {
1570
1570
  if (subagentType) {
1571
1571
  const strategy = resolveStrategy(subagentType, contextEngine.getStrategy(subagentType) !== undefined ? { [subagentType]: contextEngine.getStrategy(subagentType) } : contextConfig.strategy ?? {}, typeof args.context_override === "string" ? args.context_override : undefined);
1572
1572
  if (strategy !== "none") {
1573
+ console.error("[CONTEXT-DEBUG] before hook: strategy=", strategy, "agent=", subagentType);
1574
+ console.error("[CONTEXT-DEBUG] before hook: output.args type=", typeof output.args, "isNull=", output.args === null);
1573
1575
  const contextId = contextEngine.registerContext({
1574
1576
  description
1575
1577
  });
1578
+ output.args ??= {};
1576
1579
  output.args.description = description + contextEngine.formatMarker(contextId);
1580
+ console.error("[CONTEXT-DEBUG] before hook: marker appended, contextId=", contextId);
1581
+ console.error("[CONTEXT-DEBUG] before hook: description preview=", output.args.description.slice(-80));
1577
1582
  contextEngine.fillContextAsync(contextId, input2.sessionID, {
1578
1583
  strategy
1579
1584
  }).catch(() => {});
@@ -1620,15 +1625,21 @@ var CoHubPlugin = async (input, options) => {
1620
1625
  "experimental.chat.messages.transform": async (_input, output) => {
1621
1626
  try {
1622
1627
  if (output.messages && Array.isArray(output.messages)) {
1628
+ const userMsgs = output.messages.filter((m) => m.info?.role === "user");
1629
+ console.error("[CONTEXT-DEBUG] transform: total messages=", output.messages.length, "user messages=", userMsgs.length);
1623
1630
  for (const msg of output.messages) {
1624
1631
  if (msg.info.role !== "user")
1625
1632
  continue;
1626
1633
  for (const part of msg.parts ?? []) {
1627
1634
  if (part.type !== "text" || !part.text)
1628
1635
  continue;
1636
+ const hasMarker = /CONTEXT:ID=/.test(part.text);
1637
+ if (hasMarker) {
1638
+ console.error("[CONTEXT-DEBUG] transform: FOUND marker in user msg, text preview=", part.text.slice(0, 200));
1639
+ }
1629
1640
  const replaced = contextEngine.consumeMarkedContext(part.text);
1630
1641
  if (replaced !== null) {
1631
- part.text = replaced;
1642
+ console.error("[CONTEXT-DEBUG] transform: marker REPLACED, new text preview=", part.text.slice(0, 200));
1632
1643
  }
1633
1644
  }
1634
1645
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-cohub",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "OpenCode 中文智能体编排插件 CoHub - 纯调度模式 / 全中文提示词 / 规范分析代理 / 方案制定代理 / 独立运行",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",