groove-dev 0.25.16 → 0.25.18

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.
@@ -420,6 +420,37 @@ export function createApi(app, daemon) {
420
420
  }
421
421
  });
422
422
 
423
+ // Upload file to agent's working directory
424
+ app.post('/api/agents/:id/upload', (req, res) => {
425
+ const agent = daemon.registry.get(req.params.id);
426
+ if (!agent) return res.status(404).json({ error: 'Agent not found' });
427
+
428
+ const { filename, content } = req.body;
429
+ if (!filename || !content) return res.status(400).json({ error: 'filename and content required' });
430
+
431
+ // Sanitize filename — no path traversal
432
+ const safeName = String(filename).replace(/[/\\]/g, '_').replace(/\.\./g, '');
433
+ if (!safeName) return res.status(400).json({ error: 'Invalid filename' });
434
+
435
+ const dir = agent.workingDir || daemon.projectDir;
436
+ const filePath = resolve(dir, safeName);
437
+
438
+ // Ensure file stays within working directory
439
+ if (!filePath.startsWith(dir)) {
440
+ return res.status(400).json({ error: 'Path traversal detected' });
441
+ }
442
+
443
+ try {
444
+ mkdirSync(dir, { recursive: true });
445
+ const buffer = Buffer.from(content, 'base64');
446
+ writeFileSync(filePath, buffer);
447
+ daemon.audit.log('file.upload', { agentId: agent.id, filename: safeName, size: buffer.length });
448
+ res.json({ ok: true, path: safeName, size: buffer.length });
449
+ } catch (err) {
450
+ res.status(500).json({ error: `Upload failed: ${err.message}` });
451
+ }
452
+ });
453
+
423
454
  // List MD files for an agent (from its working directory + .groove)
424
455
  app.get('/api/agents/:id/mdfiles', (req, res) => {
425
456
  const agent = daemon.registry.get(req.params.id);
@@ -15,12 +15,19 @@ const MODES = {
15
15
  // Role-based tier hints for new agents with no classifier data yet
16
16
  const ROLE_HINTS = {
17
17
  planner: 'heavy', // Planning is foundational — needs deep reasoning
18
- docs: 'light',
19
- testing: 'medium',
18
+ fullstack: 'heavy', // End-to-end work needs full capability
19
+ slides: 'heavy', // Design quality needs top-tier model
20
+ creative: 'heavy', // Writing quality needs top-tier model
21
+ security: 'heavy', // Security audits need deep reasoning
20
22
  backend: 'medium',
21
23
  frontend: 'medium',
24
+ testing: 'medium',
22
25
  devops: 'medium',
23
- fullstack: 'heavy',
26
+ database: 'medium',
27
+ analyst: 'medium',
28
+ docs: 'light',
29
+ support: 'light',
30
+ ea: 'light',
24
31
  };
25
32
 
26
33
  export class ModelRouter {