opencode-swarm 6.53.5 → 6.53.7

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
@@ -32389,8 +32389,10 @@ var SECURITY_DEGRADING_PATTERNS = [
32389
32389
  /disable\s+.{0,50}2fa/i,
32390
32390
  /remove\s+.{0,50}password/i
32391
32391
  ];
32392
+ var INVISIBLE_FORMAT_CHARS = /[\u00AD\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/g;
32392
32393
  var INJECTION_PATTERNS = [
32393
32394
  /[\x00-\x08\x0b-\x0c\x0e-\x1f\x7f\x0d]/,
32395
+ /[\u00AD\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/,
32394
32396
  /^system\s*:/i,
32395
32397
  /<script/i,
32396
32398
  /javascript:/i,
@@ -32543,7 +32545,7 @@ function validateLesson(candidate, existingLessons, meta3) {
32543
32545
  severity: "error"
32544
32546
  };
32545
32547
  }
32546
- const normalizedCandidate = candidate.normalize("NFKC").toLowerCase();
32548
+ const normalizedCandidate = candidate.normalize("NFKC").replace(INVISIBLE_FORMAT_CHARS, " ").replace(/\s+/g, " ").toLowerCase();
32547
32549
  for (const pattern of DANGEROUS_COMMAND_PATTERNS) {
32548
32550
  if (pattern.test(normalizedCandidate)) {
32549
32551
  return {
@@ -8,6 +8,7 @@ export interface ValidationResult {
8
8
  }
9
9
  export declare const DANGEROUS_COMMAND_PATTERNS: RegExp[];
10
10
  export declare const SECURITY_DEGRADING_PATTERNS: RegExp[];
11
+ export declare const INVISIBLE_FORMAT_CHARS: RegExp;
11
12
  export declare const INJECTION_PATTERNS: RegExp[];
12
13
  export declare function validateLesson(candidate: string, existingLessons: string[], meta: {
13
14
  category: KnowledgeCategory;
package/dist/index.js CHANGED
@@ -43634,8 +43634,10 @@ var SECURITY_DEGRADING_PATTERNS = [
43634
43634
  /disable\s+.{0,50}2fa/i,
43635
43635
  /remove\s+.{0,50}password/i
43636
43636
  ];
43637
+ var INVISIBLE_FORMAT_CHARS = /[\u00AD\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/g;
43637
43638
  var INJECTION_PATTERNS = [
43638
43639
  /[\x00-\x08\x0b-\x0c\x0e-\x1f\x7f\x0d]/,
43640
+ /[\u00AD\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u2069\uFEFF]/,
43639
43641
  /^system\s*:/i,
43640
43642
  /<script/i,
43641
43643
  /javascript:/i,
@@ -43788,7 +43790,7 @@ function validateLesson(candidate, existingLessons, meta3) {
43788
43790
  severity: "error"
43789
43791
  };
43790
43792
  }
43791
- const normalizedCandidate = candidate.normalize("NFKC").toLowerCase();
43793
+ const normalizedCandidate = candidate.normalize("NFKC").replace(INVISIBLE_FORMAT_CHARS, " ").replace(/\s+/g, " ").toLowerCase();
43792
43794
  for (const pattern of DANGEROUS_COMMAND_PATTERNS) {
43793
43795
  if (pattern.test(normalizedCandidate)) {
43794
43796
  return {
@@ -45923,15 +45925,19 @@ ${phaseDigest.summary}`,
45923
45925
  async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledgeConfig) {
45924
45926
  let applied = 0;
45925
45927
  let skipped = 0;
45926
- if (recommendations.length === 0) {
45928
+ if (!recommendations || recommendations.length === 0) {
45927
45929
  return { applied, skipped };
45928
45930
  }
45931
+ if (knowledgeConfig == null) {
45932
+ return { applied: 0, skipped: 0 };
45933
+ }
45934
+ const validRecommendations = recommendations.filter((rec) => rec != null);
45929
45935
  const knowledgePath = resolveSwarmKnowledgePath(directory);
45930
45936
  const entries = await readKnowledge(knowledgePath);
45931
45937
  let modified = false;
45932
45938
  const appliedIds = new Set;
45933
45939
  const updatedEntries = entries.map((entry) => {
45934
- const rec = recommendations.find((r) => r.entry_id === entry.id);
45940
+ const rec = validRecommendations.find((r) => r.entry_id === entry.id);
45935
45941
  if (!rec)
45936
45942
  return entry;
45937
45943
  switch (rec.action) {
@@ -45985,7 +45991,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
45985
45991
  return entry;
45986
45992
  }
45987
45993
  });
45988
- for (const rec of recommendations) {
45994
+ for (const rec of validRecommendations) {
45989
45995
  if (rec.entry_id !== undefined && !appliedIds.has(rec.entry_id)) {
45990
45996
  const found = entries.some((e) => e.id === rec.entry_id);
45991
45997
  if (!found) {
@@ -45998,7 +46004,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
45998
46004
  await rewriteKnowledge(knowledgePath, updatedEntries);
45999
46005
  }
46000
46006
  const existingLessons = entries.map((e) => e.lesson);
46001
- for (const rec of recommendations) {
46007
+ for (const rec of validRecommendations) {
46002
46008
  if (rec.entry_id !== undefined)
46003
46009
  continue;
46004
46010
  if (rec.action !== "promote") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.53.5",
3
+ "version": "6.53.7",
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",