@hamp10/agentforge 0.2.43 → 0.2.45

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.43",
3
+ "version": "0.2.45",
4
4
  "description": "AgentForge worker — connect your machine to agentforge.ai",
5
5
  "type": "module",
6
6
  "bin": {
@@ -119,6 +119,14 @@ assert.deepEqual(
119
119
  ['agentboard-ai'],
120
120
  'scoped ownership should match page-owned assets named after the product, not only exact domain slugs'
121
121
  );
122
+ assert.deepEqual(
123
+ scopeSlugsMatchingText(
124
+ 'http://127.0.0.1:8000/domains/agentboard-ai.html?__agentforge_verify=1778287481427-aykulk',
125
+ ['agentboard-ai', 'agentforge-ai']
126
+ ),
127
+ ['agentboard-ai'],
128
+ 'platform cache-busting params should not make every local verification URL look like the AgentForge page'
129
+ );
122
130
 
123
131
  const git = (cwd, args) => execFileSync('git', args, { cwd, encoding: 'utf-8', stdio: 'pipe' }).trim();
124
132
 
@@ -295,6 +303,16 @@ try {
295
303
  '',
296
304
  'new untracked scoped page files should count as touched UI targets'
297
305
  );
306
+ git(fixture.repo, ['add', untrackedGammaRel]);
307
+ assert.equal(
308
+ worker._buildIncompleteScopedUiTargetsNudge(
309
+ [{ root: fixture.repo, head: fixture.head, initialDirtyPaths: [] }],
310
+ 'Work on the Example.com listing pages for Alpha.ai, Beta.ai, and Gamma.ai. Make all three pages visually polished.'
311
+ ),
312
+ '',
313
+ 'new staged scoped page files should count as touched UI targets'
314
+ );
315
+ git(fixture.repo, ['restore', '--staged', untrackedGammaRel]);
298
316
  rmSync(path.join(fixture.repo, untrackedGammaRel), { force: true });
299
317
  const untrackedShallowGammaHtml = [
300
318
  '<!doctype html>',
@@ -1319,6 +1337,16 @@ assert.match(
1319
1337
  /const visualWarnings = \[\];[\s\S]*visualWarnings\.push\(`\$\{slug\}: \$\{visualWarning\}`\);[\s\S]*continue;[\s\S]*lastDirectVisualWarning = visualWarnings\.join\('\\n'\);/i,
1320
1338
  'multi-target scoped verification should inspect every missing target before returning visual warnings'
1321
1339
  );
1340
+ assert.match(
1341
+ workerSource,
1342
+ /diff', '--cached', '--numstat'/,
1343
+ 'scoped UI target checks should count staged changes as touched targets'
1344
+ );
1345
+ assert.match(
1346
+ workerSource,
1347
+ /diff', '--cached', '--unified=0'/,
1348
+ 'UI quality artifact checks should inspect staged source diffs before commit'
1349
+ );
1322
1350
  assert.match(
1323
1351
  openClawSource,
1324
1352
  /Network\.setCacheDisabled[\s\S]*waitForRequestedDocument/i,
@@ -64,7 +64,10 @@ export function scopeSlugAliases(value) {
64
64
  }
65
65
 
66
66
  export function scopeSlugsMatchingText(value, slugs) {
67
- const text = String(value || '').toLowerCase();
67
+ const text = String(value || '')
68
+ .toLowerCase()
69
+ .replace(/[?&]__agentforge_verify=[^&#\s]*/g, ' ')
70
+ .replace(/__agentforge_verify/g, ' ');
68
71
  return (Array.isArray(slugs) ? slugs : [])
69
72
  .filter(slug => scopeSlugAliases(slug).some(alias => alias && text.includes(alias)));
70
73
  }
package/src/worker.js CHANGED
@@ -562,8 +562,12 @@ export class AgentForgeWorker extends EventEmitter {
562
562
  this._gitOutput(baseline.root, ['diff', '--numstat'], 10000),
563
563
  'working tree'
564
564
  );
565
+ const staged = this._parseNumstat(
566
+ this._gitOutput(baseline.root, ['diff', '--cached', '--numstat'], 10000),
567
+ 'staged'
568
+ );
565
569
  const byPath = new Map();
566
- for (const stat of [...committed, ...working]) {
570
+ for (const stat of [...committed, ...staged, ...working]) {
567
571
  const key = stat.path;
568
572
  const current = byPath.get(key) || { additions: 0, deletions: 0, path: key, sources: new Set() };
569
573
  current.additions += stat.additions;
@@ -1185,6 +1189,10 @@ export class AgentForgeWorker extends EventEmitter {
1185
1189
  this._gitOutput(baseline.root, ['diff', '--numstat'], 10000),
1186
1190
  'working tree'
1187
1191
  );
1192
+ const staged = this._parseNumstat(
1193
+ this._gitOutput(baseline.root, ['diff', '--cached', '--numstat'], 10000),
1194
+ 'staged'
1195
+ );
1188
1196
  const untracked = this._listUntrackedUiFiles(baseline, userMessage, { scopedOnly: true })
1189
1197
  .map(rel => {
1190
1198
  let additions = 0;
@@ -1198,7 +1206,7 @@ export class AgentForgeWorker extends EventEmitter {
1198
1206
  }
1199
1207
  return { additions, deletions: 0, path: rel, source: 'untracked' };
1200
1208
  });
1201
- const combined = [...committed, ...working, ...untracked]
1209
+ const combined = [...committed, ...staged, ...working, ...untracked]
1202
1210
  .filter(stat => /\.(html?|css|s[ac]ss|jsx?|tsx?|vue|svelte|astro|mdx?)$/i.test(stat.path));
1203
1211
  if (combined.length === 0) continue;
1204
1212
 
@@ -1349,6 +1357,7 @@ export class AgentForgeWorker extends EventEmitter {
1349
1357
  for (const baseline of repoBaselines) {
1350
1358
  const byPath = new Map();
1351
1359
  scanDiff(baseline, ['diff', '--unified=0', `${baseline.head}..HEAD`], 'committed', byPath);
1360
+ scanDiff(baseline, ['diff', '--cached', '--unified=0'], 'staged', byPath);
1352
1361
  scanDiff(baseline, ['diff', '--unified=0'], 'working tree', byPath);
1353
1362
  scanUntracked(baseline, byPath);
1354
1363
  const changedFiles = [...byPath.values()];
@@ -1584,6 +1593,7 @@ export class AgentForgeWorker extends EventEmitter {
1584
1593
 
1585
1594
  for (const baseline of repoBaselines) {
1586
1595
  scanDiff(baseline, ['diff', '--unified=0', `${baseline.head}..HEAD`], 'committed');
1596
+ scanDiff(baseline, ['diff', '--cached', '--unified=0'], 'staged');
1587
1597
  scanDiff(baseline, ['diff', '--unified=0'], 'working tree');
1588
1598
  }
1589
1599
 
@@ -1635,6 +1645,10 @@ export class AgentForgeWorker extends EventEmitter {
1635
1645
  this._gitOutput(baseline.root, ['diff', '--numstat'], 10000),
1636
1646
  'working tree'
1637
1647
  );
1648
+ const staged = this._parseNumstat(
1649
+ this._gitOutput(baseline.root, ['diff', '--cached', '--numstat'], 10000),
1650
+ 'staged'
1651
+ );
1638
1652
  const initialDirty = new Set(baseline.initialDirtyPaths || []);
1639
1653
  const untracked = String(this._gitOutput(baseline.root, ['ls-files', '--others', '--exclude-standard'], 10000) || '')
1640
1654
  .split('\n')
@@ -1643,7 +1657,7 @@ export class AgentForgeWorker extends EventEmitter {
1643
1657
  .filter(rel => uiFileRe.test(rel))
1644
1658
  .filter(rel => !initialDirty.has(rel))
1645
1659
  .filter(rel => !this._isNestedProjectCopyRel(baseline.root, rel, baseline.head || 'HEAD'));
1646
- const changedFiles = [...committed, ...working]
1660
+ const changedFiles = [...committed, ...staged, ...working]
1647
1661
  .filter(stat => uiFileRe.test(stat.path))
1648
1662
  .map(stat => stat.path)
1649
1663
  .concat(untracked);