@corbat-tech/coco 2.2.0 → 2.2.3

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/cli/index.js CHANGED
@@ -8556,9 +8556,7 @@ async function killOrphanedTestProcesses() {
8556
8556
  const result = await execa13("pgrep", ["-f", "vitest|jest.*--worker"], {
8557
8557
  reject: false
8558
8558
  });
8559
- const pids = result.stdout.split("\n").map((s) => parseInt(s.trim(), 10)).filter(
8560
- (pid) => !isNaN(pid) && pid !== process.pid && pid !== process.ppid
8561
- );
8559
+ const pids = result.stdout.split("\n").map((s) => parseInt(s.trim(), 10)).filter((pid) => !isNaN(pid) && pid !== process.pid && pid !== process.ppid);
8562
8560
  for (const pid of pids) {
8563
8561
  try {
8564
8562
  process.kill(pid, "SIGTERM");
@@ -25542,13 +25540,9 @@ function parseMarkdownSpec(content) {
25542
25540
  const featureBody = featureBodyRaw;
25543
25541
  featureIdx++;
25544
25542
  const featureId = `f-${featureIdx}`;
25545
- const bodyDescMatch = featureBody.match(
25546
- /^([^#\n][^\n]*(?:\n[^#\n][^\n]*)*?)(?=\n###|\n$|$)/m
25547
- );
25543
+ const bodyDescMatch = featureBody.match(/^([^#\n][^\n]*(?:\n[^#\n][^\n]*)*?)(?=\n###|\n$|$)/m);
25548
25544
  const featureDesc = bodyDescMatch && bodyDescMatch[1] !== void 0 ? bodyDescMatch[1].trim() : featureName;
25549
- const acMatch = featureBody.match(
25550
- /###\s+Acceptance Criteria\s*\n([\s\S]*?)(?=\n###|\n$|$)/i
25551
- );
25545
+ const acMatch = featureBody.match(/###\s+Acceptance Criteria\s*\n([\s\S]*?)(?=\n###|\n$|$)/i);
25552
25546
  const acceptanceCriteria = [];
25553
25547
  if (acMatch) {
25554
25548
  const acContent = acMatch[1];
@@ -25815,10 +25809,8 @@ async function clarify(spec, projectPath, provider, options = {}) {
25815
25809
  \u2192 Confirmed assumption: "${answer}"`
25816
25810
  );
25817
25811
  } else {
25818
- assumptions.push(
25819
- `- **${q.impact}**: ${q.question}
25820
- \u2192 User clarified: "${answer}"`
25821
- );
25812
+ assumptions.push(`- **${q.impact}**: ${q.question}
25813
+ \u2192 User clarified: "${answer}"`);
25822
25814
  }
25823
25815
  }
25824
25816
  }
@@ -25859,10 +25851,11 @@ Rules:
25859
25851
  - confidence: 0.0-1.0 (how confident you are in the assumed answer)
25860
25852
  - If the spec is clear enough, return []`;
25861
25853
  try {
25862
- const response = await provider.chat(
25863
- [{ role: "user", content: userMessage }],
25864
- { system: systemPrompt, maxTokens: 1024, temperature: 0.2 }
25865
- );
25854
+ const response = await provider.chat([{ role: "user", content: userMessage }], {
25855
+ system: systemPrompt,
25856
+ maxTokens: 1024,
25857
+ temperature: 0.2
25858
+ });
25866
25859
  const content = response.content.trim();
25867
25860
  const jsonStr = content.replace(/^```(?:json)?\s*\n?/, "").replace(/\n?```\s*$/, "");
25868
25861
  const parsed = JSON.parse(jsonStr);
@@ -26741,7 +26734,9 @@ Return JSON with: { "verdict": "APPROVE|REQUEST_CHANGES|REJECT", "score": number
26741
26734
  temperature: 0.4
26742
26735
  });
26743
26736
  const json2 = extractJson(response.content);
26744
- const avgScore = Math.round((reviews.arch.score + reviews.security.score + reviews.qa.score) / 3);
26737
+ const avgScore = Math.round(
26738
+ (reviews.arch.score + reviews.security.score + reviews.qa.score) / 3
26739
+ );
26745
26740
  return json2 ?? {
26746
26741
  verdict: avgScore >= 85 ? "APPROVE" : "REQUEST_CHANGES",
26747
26742
  score: avgScore,
@@ -26749,7 +26744,9 @@ Return JSON with: { "verdict": "APPROVE|REQUEST_CHANGES|REJECT", "score": number
26749
26744
  summary: `Synthesized review score: ${avgScore}`
26750
26745
  };
26751
26746
  } catch {
26752
- const avgScore = Math.round((reviews.arch.score + reviews.security.score + reviews.qa.score) / 3);
26747
+ const avgScore = Math.round(
26748
+ (reviews.arch.score + reviews.security.score + reviews.qa.score) / 3
26749
+ );
26753
26750
  return {
26754
26751
  verdict: avgScore >= 85 ? "APPROVE" : "REQUEST_CHANGES",
26755
26752
  score: avgScore,
@@ -26963,11 +26960,7 @@ async function runSwarm(options) {
26963
26960
  }
26964
26961
  });
26965
26962
  spinner19.stop("Swarm execution complete");
26966
- p25.outro(
26967
- chalk25.green(
26968
- `Swarm complete! Artifacts written to: ${chalk25.bold(options.output)}`
26969
- )
26970
- );
26963
+ p25.outro(chalk25.green(`Swarm complete! Artifacts written to: ${chalk25.bold(options.output)}`));
26971
26964
  } catch (error) {
26972
26965
  spinner19.stop(chalk25.red("Swarm failed"));
26973
26966
  throw error;
@@ -33750,9 +33743,7 @@ function printEnabled() {
33750
33743
  function printDisabled() {
33751
33744
  console.log(chalk25.dim(" \u26A1 full-power-risk mode: OFF"));
33752
33745
  console.log(
33753
- chalk25.dim(
33754
- " Enable with /full-power-risk on for autonomous development (less prompts)."
33755
- )
33746
+ chalk25.dim(" Enable with /full-power-risk on for autonomous development (less prompts).")
33756
33747
  );
33757
33748
  }
33758
33749
 
@@ -34182,10 +34173,7 @@ function computeEffectiveConcurrency(cfg) {
34182
34173
  return Math.max(cfg.minConcurrency, Math.floor(cfg.maxConcurrency / 2));
34183
34174
  }
34184
34175
  if (loadAvg1m > cpuCount * cfg.cpuLoadThreshold) {
34185
- return Math.max(
34186
- cfg.minConcurrency,
34187
- Math.floor(cfg.maxConcurrency * 0.75)
34188
- );
34176
+ return Math.max(cfg.minConcurrency, Math.floor(cfg.maxConcurrency * 0.75));
34189
34177
  }
34190
34178
  return cfg.maxConcurrency;
34191
34179
  }
@@ -43279,7 +43267,11 @@ async function startRepl(options = {}) {
43279
43267
  }
43280
43268
  const { loadFullAccessPreference: loadFullAccessPreference2 } = await Promise.resolve().then(() => (init_full_access_mode(), full_access_mode_exports));
43281
43269
  const { loadFullPowerRiskPreference: loadFullPowerRiskPreference2 } = await Promise.resolve().then(() => (init_full_power_risk_mode(), full_power_risk_mode_exports));
43282
- await Promise.all([loadCocoModePreference(), loadFullAccessPreference2(), loadFullPowerRiskPreference2()]);
43270
+ await Promise.all([
43271
+ loadCocoModePreference(),
43272
+ loadFullAccessPreference2(),
43273
+ loadFullPowerRiskPreference2()
43274
+ ]);
43283
43275
  const toolRegistry = createFullToolRegistry();
43284
43276
  setAgentProvider(provider);
43285
43277
  setAgentToolRegistry(toolRegistry);