oh-my-opencode-cohub 1.12.0 → 1.12.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":"config-io.d.ts","sourceRoot":"","sources":["../../src/cli/config-io.ts"],"names":[],"mappings":"AAkCA,2CAA2C;AAC3C,wBAAgB,yBAAyB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAajF;AAED,sCAAsC;AACtC,wBAAgB,oBAAoB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAa5E;AAOD,mDAAmD;AACnD,wBAAgB,mBAAmB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAiD3E;AA+ED,4DAA4D;AAC5D,wBAAgB,kBAAkB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CA2G1E;AAED,8BAA8B;AAC9B,wBAAgB,cAAc,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA6GzE"}
1
+ {"version":3,"file":"config-io.d.ts","sourceRoot":"","sources":["../../src/cli/config-io.ts"],"names":[],"mappings":"AAkCA,2CAA2C;AAC3C,wBAAgB,yBAAyB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAajF;AAED,sCAAsC;AACtC,wBAAgB,oBAAoB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAa5E;AAOD,mDAAmD;AACnD,wBAAgB,mBAAmB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAgF3E;AA+ED,4DAA4D;AAC5D,wBAAgB,kBAAkB,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CA2G1E;AAED,8BAA8B;AAC9B,wBAAgB,cAAc,IAAI;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA6GzE"}
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // package.json
3
- var version = "1.12.0";
3
+ var version = "1.12.2";
4
4
 
5
5
  // src/cli/config-io.ts
6
6
  import * as fs from "node:fs";
@@ -490,16 +490,37 @@ orchestrator 委派时可参考上述原则。不确定时,co-oracle 自身会
490
490
  };
491
491
  let added = 0;
492
492
  let migrated = 0;
493
+ let cleanedModel = 0;
493
494
  for (const [name, agentConfig] of Object.entries(cohubAgents)) {
494
495
  const existing = agents[name];
496
+ const template = agentConfig;
495
497
  if (!existing) {
496
498
  agents[name] = agentConfig;
497
499
  added++;
498
- } else if (typeof existing.prompt === "string" && existing.prompt.includes("request_plan_approval")) {
499
- existing.prompt = agentConfig.prompt;
500
+ continue;
501
+ }
502
+ let needUpdate = false;
503
+ if (typeof existing.prompt === "string" && existing.prompt.includes("request_plan_approval")) {
504
+ existing.prompt = template.prompt;
500
505
  delete existing.permission;
501
- migrated++;
506
+ needUpdate = true;
507
+ }
508
+ if (existing.mode !== template.mode) {
509
+ existing.mode = template.mode;
510
+ existing.prompt = template.prompt;
511
+ needUpdate = true;
502
512
  }
513
+ if ("model" in existing) {
514
+ delete existing.model;
515
+ needUpdate = true;
516
+ cleanedModel++;
517
+ }
518
+ if ("variant" in existing) {
519
+ delete existing.variant;
520
+ needUpdate = true;
521
+ }
522
+ if (needUpdate)
523
+ migrated++;
503
524
  }
504
525
  if (added > 0 || migrated > 0) {
505
526
  writeJSON(configPath, config);
@@ -508,7 +529,14 @@ orchestrator 委派时可参考上述原则。不确定时,co-oracle 自身会
508
529
  config.default_agent = "co-orchestrator";
509
530
  writeJSON(configPath, config);
510
531
  }
511
- return { success: true, message: `✓ CoHub 代理:新增 ${added} 个,更新 ${migrated} 个${added + migrated === 0 ? "(全部已是最新,跳过)" : ""}` };
532
+ const parts = [];
533
+ if (added > 0)
534
+ parts.push(`新增 ${added} 个`);
535
+ if (migrated > 0)
536
+ parts.push(`更新 ${migrated} 个`);
537
+ if (cleanedModel > 0)
538
+ parts.push(`清理 ${cleanedModel} 个 model/variant 残留`);
539
+ return { success: true, message: `✓ CoHub 代理:${parts.join(",")}${parts.length === 0 ? "(全部已是最新,跳过)" : ""}` };
512
540
  }
513
541
  var COHUB_CONFIG_PATH = path.join(os.homedir(), ".config", "opencode", "oh-my-opencode-cohub.json");
514
542
  var HEAVY_KEYWORDS = ["pro", "preview", "opus", "max", "sonnet", "gpt-5.6"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-cohub",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Mr-cjf/oh-my-opencode-cohub.git"