@yemi33/squad 0.1.11 → 0.1.12

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/dashboard.html CHANGED
@@ -47,6 +47,7 @@
47
47
  .status-badge.working { background: rgba(210,153,34,0.15); color: var(--yellow); border: 1px solid var(--yellow); animation: pulse 1.5s infinite; }
48
48
  .status-badge.done { background: rgba(63,185,80,0.15); color: var(--green); border: 1px solid var(--green); }
49
49
  .agent-action { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
50
+ .agent-result { font-size: 10px; color: var(--text); background: var(--surface2); padding: 6px 8px; border-radius: 4px; margin-top: 6px; white-space: pre-wrap; word-break: break-word; max-height: 80px; overflow-y: auto; line-height: 1.4; border-left: 2px solid var(--blue); }
50
51
  .agent-card { min-width: 0; }
51
52
  .agent-emoji { font-size: 20px; margin-right: 4px; }
52
53
  .click-hint { font-size: 10px; color: var(--border); margin-top: 6px; }
@@ -671,6 +672,7 @@ function renderAgents(agents) {
671
672
  </div>
672
673
  <div class="agent-role">${a.role}</div>
673
674
  <div class="agent-action" title="${escHtml(a.lastAction)}">${escHtml(a.lastAction)}</div>
675
+ ${a.resultSummary ? `<div class="agent-result" title="${escHtml(a.resultSummary)}">${escHtml(a.resultSummary.slice(0, 200))}${a.resultSummary.length > 200 ? '...' : ''}</div>` : ''}
674
676
  </div>
675
677
  `).join('');
676
678
  }
package/dashboard.js CHANGED
@@ -99,6 +99,7 @@ function getAgents() {
99
99
  let status = 'idle';
100
100
  let lastAction = 'Waiting for assignment';
101
101
  let currentTask = '';
102
+ let resultSummary = '';
102
103
 
103
104
  const statusFile = safeRead(path.join(SQUAD_DIR, 'agents', a.id, 'status.json'));
104
105
  if (statusFile) {
@@ -106,6 +107,7 @@ function getAgents() {
106
107
  const sj = JSON.parse(statusFile);
107
108
  status = sj.status || 'idle';
108
109
  currentTask = sj.task || '';
110
+ resultSummary = sj.resultSummary || '';
109
111
  if (sj.status === 'working') {
110
112
  lastAction = `Working: ${sj.task}`;
111
113
  } else if (sj.status === 'done') {
@@ -126,7 +128,7 @@ function getAgents() {
126
128
  const chartered = fs.existsSync(path.join(SQUAD_DIR, 'agents', a.id, 'charter.md'));
127
129
  // Truncate lastAction to prevent UI overflow from corrupted data
128
130
  if (lastAction.length > 120) lastAction = lastAction.slice(0, 120) + '...';
129
- return { ...a, status, lastAction, currentTask: (currentTask || '').slice(0, 200), chartered, inboxCount: inboxFiles.length };
131
+ return { ...a, status, lastAction, currentTask: (currentTask || '').slice(0, 200), resultSummary: (resultSummary || '').slice(0, 500), chartered, inboxCount: inboxFiles.length };
130
132
  });
131
133
  }
132
134
 
package/engine.js CHANGED
@@ -738,6 +738,23 @@ function spawnAgent(dispatchItem, config) {
738
738
  safeWrite(archivePath, outputContent);
739
739
  safeWrite(latestPath, outputContent); // overwrite latest for dashboard compat
740
740
 
741
+ // Extract agent's final result text from stream-json output
742
+ let resultSummary = '';
743
+ try {
744
+ const lines = stdout.split('\n');
745
+ for (let i = lines.length - 1; i >= 0; i--) {
746
+ const line = lines[i].trim();
747
+ if (!line || !line.startsWith('{')) continue;
748
+ try {
749
+ const obj = JSON.parse(line);
750
+ if (obj.type === 'result' && obj.result) {
751
+ resultSummary = obj.result.slice(0, 500);
752
+ break;
753
+ }
754
+ } catch {}
755
+ }
756
+ } catch {}
757
+
741
758
  // Update agent status
742
759
  setAgentStatus(agentId, {
743
760
  status: code === 0 ? 'done' : 'error',
@@ -747,7 +764,8 @@ function spawnAgent(dispatchItem, config) {
747
764
  branch: branchName,
748
765
  exit_code: code,
749
766
  started_at: startedAt,
750
- completed_at: ts()
767
+ completed_at: ts(),
768
+ resultSummary: resultSummary || undefined,
751
769
  });
752
770
 
753
771
  // Move from active to completed in dispatch
@@ -2012,7 +2030,7 @@ function updateMetrics(agentId, dispatchItem, result) {
2012
2030
  let _consolidationInFlight = false;
2013
2031
 
2014
2032
  function consolidateInbox(config) {
2015
- const threshold = config.engine?.inboxConsolidateThreshold || 1;
2033
+ const threshold = config.engine?.inboxConsolidateThreshold || 3;
2016
2034
  const files = getInboxFiles();
2017
2035
  if (files.length < threshold) return;
2018
2036
  if (_consolidationInFlight) return;
@@ -3301,6 +3319,9 @@ function discoverFromWorkItems(config, project) {
3301
3319
  item_name: item.title || item.id,
3302
3320
  item_priority: item.priority || 'medium',
3303
3321
  item_description: item.description || '',
3322
+ item_complexity: item.complexity || item.estimated_complexity || 'medium',
3323
+ task_description: item.title + (item.description ? '\n\n' + item.description : ''),
3324
+ task_id: item.id,
3304
3325
  work_type: workType,
3305
3326
  additional_context: item.prompt ? `## Additional Context\n\n${item.prompt}` : '',
3306
3327
  scope_section: `## Scope: Project — ${project?.name || 'default'}\n\nThis task is scoped to a single project.`,
@@ -3315,8 +3336,10 @@ function discoverFromWorkItems(config, project) {
3315
3336
  ado_org: project?.adoOrg || 'Unknown',
3316
3337
  ado_project: project?.adoProject || 'Unknown',
3317
3338
  repo_name: project?.repoName || 'Unknown',
3318
- date: dateStamp()
3339
+ date: dateStamp(),
3340
+ notes_content: '',
3319
3341
  };
3342
+ try { vars.notes_content = fs.readFileSync(path.join(SQUAD_DIR, 'notes.md'), 'utf8'); } catch {}
3320
3343
 
3321
3344
  // Inject ask-specific variables for the ask playbook
3322
3345
  if (workType === 'ask') {
@@ -3661,6 +3684,9 @@ function discoverCentralWorkItems(config) {
3661
3684
  item_name: item.title || item.id,
3662
3685
  item_priority: item.priority || 'medium',
3663
3686
  item_description: item.description || '',
3687
+ item_complexity: item.complexity || item.estimated_complexity || 'medium',
3688
+ task_description: item.title + (item.description ? '\n\n' + item.description : ''),
3689
+ task_id: item.id,
3664
3690
  work_type: workType,
3665
3691
  additional_context: item.prompt ? `## Additional Context\n\n${item.prompt}` : '',
3666
3692
  scope_section: buildProjectContext(projects, null, false, agentName, agentRole),
@@ -3672,8 +3698,10 @@ function discoverCentralWorkItems(config) {
3672
3698
  ado_project: firstProject?.adoProject || 'Unknown',
3673
3699
  repo_name: firstProject?.repoName || 'Unknown',
3674
3700
  team_root: SQUAD_DIR,
3675
- date: dateStamp()
3701
+ date: dateStamp(),
3702
+ notes_content: '',
3676
3703
  };
3704
+ try { vars.notes_content = fs.readFileSync(path.join(SQUAD_DIR, 'notes.md'), 'utf8'); } catch {}
3677
3705
 
3678
3706
  // Inject plan-specific variables for the plan playbook
3679
3707
  if (workType === 'plan') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/squad",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.squad/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "squad": "bin/squad.js"