@hamp10/agentforge 0.2.30 → 0.2.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hamp10/agentforge",
3
- "version": "0.2.30",
3
+ "version": "0.2.31",
4
4
  "description": "AgentForge worker — connect your machine to agentforge.ai",
5
5
  "type": "module",
6
6
  "bin": {
@@ -555,6 +555,22 @@ try {
555
555
  /existing scoped page target/i,
556
556
  'scoped page work should not create a new same-slug page when an existing scoped target page is present'
557
557
  );
558
+ const nestedDuplicateGamma = path.join(fixture.repo, path.basename(fixture.repo), 'public_html', 'domains', 'gamma.html');
559
+ mkdirSync(path.dirname(nestedDuplicateGamma), { recursive: true });
560
+ writeFileSync(nestedDuplicateGamma, '<!doctype html><html><body><h1>Gamma</h1></body></html>');
561
+ assert.doesNotThrow(
562
+ () => cli._guardDirectFileWritePath(
563
+ path.join(fixture.repo, 'public_html', 'domains', 'gamma.html'),
564
+ fixture.repo,
565
+ { task: 'Can you make listing pages for Gamma?' }
566
+ ),
567
+ 'nested duplicate project copies should not block recreating the canonical page path'
568
+ );
569
+ assert.equal(
570
+ cli._directScopeFileCandidates(fixture.repo, ['gamma']).some(candidate => candidate.startsWith(`${path.basename(fixture.repo)}/`)),
571
+ false,
572
+ 'scope candidates should not steer agents toward nested project-copy paths when the canonical parent exists'
573
+ );
558
574
  const extractedOldCss = Array.from({ length: 28 }, (_, i) =>
559
575
  `.hero-polish-${i} { color: #${String(100000 + i).slice(0, 6)}; padding: ${i + 1}px; margin: ${i}px; box-shadow: 0 0 ${i + 2}px rgba(0,0,0,.1); }`
560
576
  ).join('\n');
@@ -694,7 +694,10 @@ export class OpenClawCLI extends EventEmitter {
694
694
  walk(workDir, 0);
695
695
  const resultSet = new Set(results);
696
696
  return results.filter(rel => {
697
- const canonical = this._nestedProjectDuplicateCanonicalPath(path.resolve(workDir, rel), workDir);
697
+ const absolute = path.resolve(workDir, rel);
698
+ const nestedCanonical = this._nestedProjectCopyCanonicalPath(absolute, workDir);
699
+ if (nestedCanonical && existsSync(path.dirname(nestedCanonical))) return false;
700
+ const canonical = this._nestedProjectDuplicateCanonicalPath(absolute, workDir);
698
701
  if (!canonical) return true;
699
702
  const canonicalRel = path.relative(workDir, canonical) || canonical;
700
703
  return !resultSet.has(canonicalRel);