opencode-swarm 7.27.2 → 7.27.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
@@ -34,7 +34,7 @@ var package_default;
34
34
  var init_package = __esm(() => {
35
35
  package_default = {
36
36
  name: "opencode-swarm",
37
- version: "7.27.2",
37
+ version: "7.27.3",
38
38
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
39
39
  main: "dist/index.js",
40
40
  types: "dist/index.d.ts",
package/dist/index.js CHANGED
@@ -48,7 +48,7 @@ var package_default;
48
48
  var init_package = __esm(() => {
49
49
  package_default = {
50
50
  name: "opencode-swarm",
51
- version: "7.27.2",
51
+ version: "7.27.3",
52
52
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
53
53
  main: "dist/index.js",
54
54
  types: "dist/index.d.ts",
@@ -37074,14 +37074,32 @@ function createGuardrailsHooks(directory, directoryOrConfig, config2, authorityC
37074
37074
  if (!analysis.hasWrites || analysis.writes.length === 0)
37075
37075
  return;
37076
37076
  const declaredScope = resolveDeclaredScope(sessionID);
37077
- if (!declaredScope || declaredScope.length === 0)
37077
+ const shellWriteAgent = swarmState.activeAgent.get(sessionID);
37078
+ if (!shellWriteAgent) {
37079
+ throw new Error(`WRITE BLOCKED: No active agent registered for session "${sessionID}". Call startAgentSession before issuing shell write operations.`);
37080
+ }
37081
+ const isArchitect2 = stripKnownSwarmPrefix(shellWriteAgent).toLowerCase() === "architect";
37082
+ if (!isArchitect2 && (!declaredScope || declaredScope.length === 0)) {
37078
37083
  return;
37084
+ }
37079
37085
  const resolvedWrites = resolveWriteTargets(command, analysis.writes, effectiveDirectory);
37080
37086
  for (const write of resolvedWrites) {
37081
37087
  if (write.resolvedPath === null) {
37082
37088
  throw new Error(`BLOCKED: bash/shell write operation with unresolvable path target — rejecting for safety`);
37083
37089
  }
37084
- if (!isInDeclaredScope(write.resolvedPath, declaredScope, effectiveDirectory)) {
37090
+ if (universalDenyPrefixes.length > 0) {
37091
+ const normalizedPath = path11.relative(path11.resolve(effectiveDirectory), path11.resolve(effectiveDirectory, write.resolvedPath)).replace(/\\/g, "/");
37092
+ for (const prefix of universalDenyPrefixes) {
37093
+ if (normalizedPath.toLowerCase().startsWith(prefix.toLowerCase())) {
37094
+ throw new Error(`WRITE BLOCKED: Agent "${shellWriteAgent}" is not authorised to write "${write.resolvedPath}" (via shell). Reason: Path is under universal deny prefix "${prefix}"`);
37095
+ }
37096
+ }
37097
+ }
37098
+ const authorityCheck = checkFileAuthorityWithRules(shellWriteAgent, write.resolvedPath, effectiveDirectory, precomputedAuthorityRules, { declaredScope });
37099
+ if (!authorityCheck.allowed) {
37100
+ throw new Error(`WRITE BLOCKED: Agent "${shellWriteAgent}" is not authorised to write "${write.resolvedPath}" (via shell). Reason: ${authorityCheck.reason}`);
37101
+ }
37102
+ if (declaredScope && declaredScope.length > 0 && !isInDeclaredScope(write.resolvedPath, declaredScope, effectiveDirectory)) {
37085
37103
  throw new Error(`bash write detected outside declared scope: ${write.resolvedPath} (original: ${write.original.path})`);
37086
37104
  }
37087
37105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.27.2",
3
+ "version": "7.27.3",
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",