opencode-swarm 7.65.0 → 7.65.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.
package/dist/cli/index.js CHANGED
@@ -52,7 +52,7 @@ var package_default;
52
52
  var init_package = __esm(() => {
53
53
  package_default = {
54
54
  name: "opencode-swarm",
55
- version: "7.65.0",
55
+ version: "7.65.2",
56
56
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
57
57
  main: "dist/index.js",
58
58
  types: "dist/index.d.ts",
@@ -46897,9 +46897,10 @@ import { extname as extname3, join as join30 } from "path";
46897
46897
  async function detectProjectLanguages(projectDir) {
46898
46898
  const detected = new Set;
46899
46899
  async function scanDir(dir) {
46900
+ let dirEntries;
46900
46901
  let entries;
46901
46902
  try {
46902
- const dirEntries = await readdir2(dir, { withFileTypes: true });
46903
+ dirEntries = await readdir2(dir, { withFileTypes: true });
46903
46904
  entries = dirEntries.map((e) => e.name);
46904
46905
  } catch {
46905
46906
  return;
@@ -46908,7 +46909,7 @@ async function detectProjectLanguages(projectDir) {
46908
46909
  for (const detectFile of profile.build.detectFiles) {
46909
46910
  if (detectFile.includes("*") || detectFile.includes("?")) {
46910
46911
  const regex = new RegExp(`^${detectFile.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".")}$`);
46911
- if (entries.some((name) => regex.test(name))) {
46912
+ if (dirEntries.some((e) => !e.isDirectory() && regex.test(e.name))) {
46912
46913
  detected.add(profile.id);
46913
46914
  break;
46914
46915
  }
package/dist/index.js CHANGED
@@ -69,7 +69,7 @@ var package_default;
69
69
  var init_package = __esm(() => {
70
70
  package_default = {
71
71
  name: "opencode-swarm",
72
- version: "7.65.0",
72
+ version: "7.65.2",
73
73
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
74
74
  main: "dist/index.js",
75
75
  types: "dist/index.d.ts",
@@ -70012,9 +70012,10 @@ function getProfileForFile(filePath) {
70012
70012
  async function detectProjectLanguages(projectDir) {
70013
70013
  const detected = new Set;
70014
70014
  async function scanDir(dir) {
70015
+ let dirEntries;
70015
70016
  let entries;
70016
70017
  try {
70017
- const dirEntries = await readdir3(dir, { withFileTypes: true });
70018
+ dirEntries = await readdir3(dir, { withFileTypes: true });
70018
70019
  entries = dirEntries.map((e) => e.name);
70019
70020
  } catch {
70020
70021
  return;
@@ -70023,7 +70024,7 @@ async function detectProjectLanguages(projectDir) {
70023
70024
  for (const detectFile of profile.build.detectFiles) {
70024
70025
  if (detectFile.includes("*") || detectFile.includes("?")) {
70025
70026
  const regex = new RegExp(`^${detectFile.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".")}$`);
70026
- if (entries.some((name2) => regex.test(name2))) {
70027
+ if (dirEntries.some((e) => !e.isDirectory() && regex.test(e.name))) {
70027
70028
  detected.add(profile.id);
70028
70029
  break;
70029
70030
  }
@@ -91661,8 +91662,17 @@ function createAgents(config3, projectContext = emptyProjectContext()) {
91661
91662
  const swarms = config3?.swarms;
91662
91663
  if (swarms && Object.keys(swarms).length > 0) {
91663
91664
  for (const swarmId of Object.keys(swarms)) {
91664
- const swarmConfig = swarms[swarmId];
91665
+ let swarmConfig = swarms[swarmId];
91665
91666
  const isDefault = swarmId === "default";
91667
+ if (config3?.agents) {
91668
+ swarmConfig = {
91669
+ ...swarmConfig,
91670
+ agents: {
91671
+ ...config3.agents,
91672
+ ...swarmConfig.agents ?? {}
91673
+ }
91674
+ };
91675
+ }
91666
91676
  const swarmAgents = createSwarmAgents(swarmId, swarmConfig, isDefault, config3, projectContext);
91667
91677
  allAgents.push(...swarmAgents);
91668
91678
  }
@@ -98403,10 +98413,16 @@ function writeProjectConfigIfNew(directory, quiet = false) {
98403
98413
  try {
98404
98414
  const opencodeDir = path85.join(directory, ".opencode");
98405
98415
  const dest = path85.join(opencodeDir, "opencode-swarm.json");
98416
+ const normalizePathForCompare = (p) => process.platform === "win32" ? p.toLowerCase() : p;
98406
98417
  try {
98407
98418
  const stat6 = fs49.lstatSync(opencodeDir);
98408
98419
  if (stat6.isSymbolicLink())
98409
98420
  return;
98421
+ const resolvedDir = fs49.realpathSync(opencodeDir);
98422
+ const canonicalOpencode = path85.join(fs49.realpathSync(directory), ".opencode");
98423
+ if (normalizePathForCompare(resolvedDir) !== normalizePathForCompare(canonicalOpencode)) {
98424
+ return;
98425
+ }
98410
98426
  } catch (err2) {
98411
98427
  if (err2.code !== "ENOENT")
98412
98428
  return;
@@ -101664,7 +101680,7 @@ import * as path103 from "node:path";
101664
101680
  init_logger();
101665
101681
  init_path_security();
101666
101682
  import * as fsSync5 from "node:fs";
101667
- import { existsSync as existsSync61, realpathSync as realpathSync12 } from "node:fs";
101683
+ import { existsSync as existsSync61, realpathSync as realpathSync13 } from "node:fs";
101668
101684
  import * as fsPromises5 from "node:fs/promises";
101669
101685
  import * as os14 from "node:os";
101670
101686
  import * as path99 from "node:path";
@@ -102136,8 +102152,8 @@ var symbols = createSwarmTool({
102136
102152
  });
102137
102153
 
102138
102154
  // src/tools/repo-graph/safe-realpath.ts
102139
- import { realpathSync as realpathSync11 } from "node:fs";
102140
- function safeRealpathSync(targetPath, fallback, realpathResolver = realpathSync11) {
102155
+ import { realpathSync as realpathSync12 } from "node:fs";
102156
+ function safeRealpathSync(targetPath, fallback, realpathResolver = realpathSync12) {
102141
102157
  try {
102142
102158
  return realpathResolver(targetPath);
102143
102159
  } catch (error93) {
@@ -102410,7 +102426,7 @@ function resolveModuleSpecifier(workspaceRoot, sourceFile, specifier) {
102410
102426
  function isRefusedWorkspaceRoot(target) {
102411
102427
  let resolved;
102412
102428
  try {
102413
- resolved = realpathSync12(target);
102429
+ resolved = realpathSync13(target);
102414
102430
  } catch {
102415
102431
  resolved = path99.resolve(target);
102416
102432
  }
@@ -112664,7 +112680,7 @@ import {
112664
112680
  mkdirSync as mkdirSync33,
112665
112681
  mkdtempSync as mkdtempSync2,
112666
112682
  readFileSync as readFileSync49,
112667
- realpathSync as realpathSync15,
112683
+ realpathSync as realpathSync16,
112668
112684
  renameSync as renameSync23,
112669
112685
  rmdirSync as rmdirSync2,
112670
112686
  unlinkSync as unlinkSync18,
@@ -112698,8 +112714,8 @@ function containsStrictControlChars(str) {
112698
112714
  }
112699
112715
  function isCanonicalProtectedPath(targetPath, workspace) {
112700
112716
  try {
112701
- const canonicalTarget = realpathSync15(targetPath);
112702
- const canonicalWorkspace = realpathSync15(workspace);
112717
+ const canonicalTarget = realpathSync16(targetPath);
112718
+ const canonicalWorkspace = realpathSync16(workspace);
112703
112719
  const relative25 = path127.relative(canonicalWorkspace, canonicalTarget).replace(/\\/g, "/");
112704
112720
  const segments = relative25.split("/").filter(Boolean);
112705
112721
  return segments.some((seg) => seg === ".git" || seg === ".swarm");
@@ -112708,8 +112724,8 @@ function isCanonicalProtectedPath(targetPath, workspace) {
112708
112724
  if (parentDir === targetPath)
112709
112725
  return false;
112710
112726
  try {
112711
- const canonicalParent = realpathSync15(parentDir);
112712
- const canonicalWorkspace = realpathSync15(workspace);
112727
+ const canonicalParent = realpathSync16(parentDir);
112728
+ const canonicalWorkspace = realpathSync16(workspace);
112713
112729
  const relative25 = path127.relative(canonicalWorkspace, canonicalParent).replace(/\\/g, "/");
112714
112730
  const segments = relative25.split("/").filter(Boolean);
112715
112731
  return segments.some((seg) => seg === ".git" || seg === ".swarm");
@@ -112720,8 +112736,8 @@ function isCanonicalProtectedPath(targetPath, workspace) {
112720
112736
  }
112721
112737
  function isCanonicalPathWithinWorkspace(targetPath, workspaceRoot) {
112722
112738
  try {
112723
- const canonicalTarget = realpathSync15(targetPath);
112724
- const canonicalWorkspace = realpathSync15(workspaceRoot);
112739
+ const canonicalTarget = realpathSync16(targetPath);
112740
+ const canonicalWorkspace = realpathSync16(workspaceRoot);
112725
112741
  const relative25 = path127.relative(canonicalWorkspace, canonicalTarget);
112726
112742
  if (relative25.startsWith("..") || path127.isAbsolute(relative25))
112727
112743
  return false;
@@ -112735,8 +112751,8 @@ function isCanonicalPathWithinWorkspace(targetPath, workspaceRoot) {
112735
112751
  return false;
112736
112752
  }
112737
112753
  try {
112738
- const canonicalParent = realpathSync15(parentDir);
112739
- const canonicalWorkspace = realpathSync15(workspaceRoot);
112754
+ const canonicalParent = realpathSync16(parentDir);
112755
+ const canonicalWorkspace = realpathSync16(workspaceRoot);
112740
112756
  const relative25 = path127.relative(canonicalWorkspace, canonicalParent);
112741
112757
  if (relative25.startsWith("..") || path127.isAbsolute(relative25))
112742
112758
  return false;
@@ -113014,7 +113030,7 @@ function atomicWriteFileSync(targetPath, content) {
113014
113030
  const tempPrefix = `.apply-patch-${Date.now()}-${process.pid}`;
113015
113031
  let tempPath;
113016
113032
  try {
113017
- const tempDir = realpathSync15(mkdtempSync2(path127.join(dir, tempPrefix)));
113033
+ const tempDir = realpathSync16(mkdtempSync2(path127.join(dir, tempPrefix)));
113018
113034
  tempPath = path127.join(tempDir, "content");
113019
113035
  } catch {
113020
113036
  tempPath = path127.join(dir, `${tempPrefix}.tmp`);
@@ -128895,6 +128911,8 @@ async function executeWithTimeout(command, args2, options) {
128895
128911
  });
128896
128912
  let stdout = "";
128897
128913
  let stderr = "";
128914
+ let stdoutBytes = 0;
128915
+ let stderrBytes = 0;
128898
128916
  let stdoutTruncated = false;
128899
128917
  let stderrTruncated = false;
128900
128918
  let settled = false;
@@ -128935,25 +128953,36 @@ async function executeWithTimeout(command, args2, options) {
128935
128953
  if (stdoutTruncated)
128936
128954
  return;
128937
128955
  const chunk = data.toString();
128938
- if (stdout.length + chunk.length > maxOutputBytes) {
128939
- stdout += chunk.slice(0, Math.max(0, maxOutputBytes - stdout.length));
128956
+ const chunkBytes = Buffer.byteLength(chunk, "utf8");
128957
+ if (stdoutBytes + chunkBytes > maxOutputBytes) {
128958
+ const remaining = Math.max(0, maxOutputBytes - stdoutBytes);
128959
+ stdout += Buffer.from(chunk, "utf8").subarray(0, remaining).toString("utf8");
128960
+ stdoutBytes = maxOutputBytes;
128940
128961
  stdoutTruncated = true;
128941
128962
  try {
128942
128963
  child.kill("SIGTERM");
128943
128964
  } catch {}
128944
128965
  } else {
128945
128966
  stdout += chunk;
128967
+ stdoutBytes += chunkBytes;
128946
128968
  }
128947
128969
  });
128948
128970
  child.stderr?.on("data", (data) => {
128949
128971
  if (stderrTruncated)
128950
128972
  return;
128951
128973
  const chunk = data.toString();
128952
- if (stderr.length + chunk.length > maxOutputBytes) {
128953
- stderr += chunk.slice(0, Math.max(0, maxOutputBytes - stderr.length));
128974
+ const chunkBytes = Buffer.byteLength(chunk, "utf8");
128975
+ if (stderrBytes + chunkBytes > maxOutputBytes) {
128976
+ const remaining = Math.max(0, maxOutputBytes - stderrBytes);
128977
+ stderr += Buffer.from(chunk, "utf8").subarray(0, remaining).toString("utf8");
128978
+ stderrBytes = maxOutputBytes;
128954
128979
  stderrTruncated = true;
128980
+ try {
128981
+ child.kill("SIGTERM");
128982
+ } catch {}
128955
128983
  } else {
128956
128984
  stderr += chunk;
128985
+ stderrBytes += chunkBytes;
128957
128986
  }
128958
128987
  });
128959
128988
  child.on("close", (code) => {
@@ -12,18 +12,8 @@
12
12
  * the rationale. `detectLaravelProject` / `getLaravelCommandOverlay` are
13
13
  * filesystem-only (no subprocess), so they are safe on the session-init path.
14
14
  */
15
- import type { FrameworkSelection, LanguageBackend } from '../backend';
16
- /**
17
- * Detect Laravel via the multi-signal heuristic (artisan + composer.json
18
- * require + config/app.php; ≥2 of 3). Returns null for generic Composer PHP
19
- * projects so the architect's PROJECT_FRAMEWORK stays unresolved.
20
- */
21
- declare function selectFramework(dir: string): Promise<FrameworkSelection | null>;
15
+ import type { LanguageBackend } from '../backend';
22
16
  /**
23
17
  * Build the PHP backend from the registered profile.
24
18
  */
25
19
  export declare function buildPhpBackend(): LanguageBackend;
26
- export declare const _internals: {
27
- selectFramework: typeof selectFramework;
28
- };
29
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.65.0",
3
+ "version": "7.65.2",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",