@yemi33/minions 0.1.32 → 0.1.34

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.34 (2026-03-28)
4
+
5
+ ### Dashboard
6
+ - dashboard/js/render-work-items.js
7
+ - dashboard/pages/work.html
8
+
9
+ ## 0.1.33 (2026-03-28)
10
+
11
+ ### Dashboard
12
+ - dashboard.js
13
+
3
14
  ## 0.1.32 (2026-03-28)
4
15
 
5
16
  ### Dashboard
@@ -273,6 +273,84 @@ async function submitFeedback(id, source) {
273
273
  } catch (e) { alert('Error: ' + e.message); }
274
274
  }
275
275
 
276
+ function openCreateWorkItemModal() {
277
+ const typeOpts = ['implement', 'fix', 'explore', 'test', 'review', 'ask', 'plan'].map(t =>
278
+ '<option value="' + t + '"' + (t === 'implement' ? ' selected' : '') + '>' + t + '</option>'
279
+ ).join('');
280
+ const priOpts = ['high', 'medium', 'low'].map(p =>
281
+ '<option value="' + p + '"' + (p === 'medium' ? ' selected' : '') + '>' + p + '</option>'
282
+ ).join('');
283
+ const agentOpts = (typeof cmdAgents !== 'undefined' ? cmdAgents : []).map(a =>
284
+ '<option value="' + escHtml(a.id) + '">' + escHtml(a.name) + '</option>'
285
+ ).join('');
286
+ const projOpts = (typeof cmdProjects !== 'undefined' ? cmdProjects : []).map(p =>
287
+ '<option value="' + escHtml(p) + '">' + escHtml(p) + '</option>'
288
+ ).join('');
289
+ const inputStyle = 'display:block;width:100%;margin-top:4px;padding:6px 8px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text);font-size:var(--text-md);font-family:inherit';
290
+
291
+ document.getElementById('modal-title').textContent = 'Create Work Item';
292
+ document.getElementById('modal-body').innerHTML =
293
+ '<div style="display:flex;flex-direction:column;gap:10px">' +
294
+ '<label style="color:var(--text);font-size:var(--text-md)">Title <input id="wi-new-title" style="' + inputStyle + '" placeholder="What needs to be done?"></label>' +
295
+ '<label style="color:var(--text);font-size:var(--text-md)">Description <textarea id="wi-new-desc" rows="3" style="' + inputStyle + ';resize:vertical" placeholder="Detailed description..."></textarea></label>' +
296
+ '<div style="display:flex;gap:8px">' +
297
+ '<label style="flex:1;color:var(--text);font-size:var(--text-md)">Type <select id="wi-new-type" style="' + inputStyle + '">' + typeOpts + '</select></label>' +
298
+ '<label style="flex:1;color:var(--text);font-size:var(--text-md)">Priority <select id="wi-new-priority" style="' + inputStyle + '">' + priOpts + '</select></label>' +
299
+ '</div>' +
300
+ '<div style="display:flex;gap:8px">' +
301
+ '<label style="flex:1;color:var(--text);font-size:var(--text-md)">Agent <select id="wi-new-agent" style="' + inputStyle + '"><option value="">Auto</option>' + agentOpts + '</select></label>' +
302
+ '<label style="flex:1;color:var(--text);font-size:var(--text-md)">Project <select id="wi-new-project" style="' + inputStyle + '"><option value="">Central</option>' + projOpts + '</select></label>' +
303
+ '</div>' +
304
+ '<label style="color:var(--text);font-size:var(--text-md)">Acceptance Criteria <textarea id="wi-new-ac" rows="2" style="' + inputStyle + ';resize:vertical" placeholder="One criterion per line (optional)"></textarea></label>' +
305
+ '<label style="color:var(--text);font-size:var(--text-md)">References <textarea id="wi-new-refs" rows="2" style="' + inputStyle + ';resize:vertical" placeholder="url | title | type — one per line (optional)"></textarea></label>' +
306
+ '<div style="display:flex;justify-content:flex-end;gap:8px;margin-top:4px">' +
307
+ '<button onclick="closeModal()" class="pr-pager-btn">Cancel</button>' +
308
+ '<button onclick="_submitCreateWorkItem()" style="padding:6px 16px;background:var(--blue);color:#fff;border:none;border-radius:var(--radius-sm);cursor:pointer">Create</button>' +
309
+ '</div>' +
310
+ '</div>';
311
+ document.getElementById('modal').classList.add('open');
312
+ setTimeout(() => document.getElementById('wi-new-title')?.focus(), 100);
313
+ }
314
+
315
+ async function _submitCreateWorkItem() {
316
+ const title = document.getElementById('wi-new-title')?.value?.trim();
317
+ if (!title) { alert('Title is required'); return; }
318
+ const desc = document.getElementById('wi-new-desc')?.value || '';
319
+ const type = document.getElementById('wi-new-type')?.value || 'implement';
320
+ const priority = document.getElementById('wi-new-priority')?.value || 'medium';
321
+ const agent = document.getElementById('wi-new-agent')?.value || '';
322
+ const project = document.getElementById('wi-new-project')?.value || '';
323
+ const acRaw = document.getElementById('wi-new-ac')?.value || '';
324
+ const acceptanceCriteria = acRaw.split('\n').map(l => l.trim()).filter(Boolean);
325
+ const refsRaw = document.getElementById('wi-new-refs')?.value || '';
326
+ const references = refsRaw.split('\n').filter(l => l.trim()).map(l => {
327
+ const parts = l.split('|').map(s => s.trim());
328
+ return { url: parts[0], title: parts[1] || parts[0], type: parts[2] || 'link' };
329
+ });
330
+
331
+ try {
332
+ const body = { title, description: desc, type, priority };
333
+ if (agent) body.agents = [agent];
334
+ if (project) body.project = project;
335
+ if (acceptanceCriteria.length) body.acceptanceCriteria = acceptanceCriteria;
336
+ if (references.length && references[0].url) body.references = references;
337
+
338
+ const res = await fetch('/api/work-items', {
339
+ method: 'POST', headers: { 'Content-Type': 'application/json' },
340
+ body: JSON.stringify(body)
341
+ });
342
+ const data = await res.json();
343
+ if (res.ok) {
344
+ try { closeModal(); } catch {}
345
+ wakeEngine();
346
+ refresh();
347
+ try { showToast('cmd-toast', 'Work item ' + (data.id || '') + ' created', true); } catch {}
348
+ } else {
349
+ alert('Failed: ' + (data.error || 'unknown'));
350
+ }
351
+ } catch (e) { alert('Error: ' + e.message); }
352
+ }
353
+
276
354
  function openAllWorkItems() {
277
355
  document.getElementById('modal-title').textContent = 'All Work Items (' + allWorkItems.length + ')';
278
356
  const html = '<div class="pr-table-wrap"><table class="pr-table"><thead><tr><th>ID</th><th>Title</th><th>Source</th><th>Type</th><th>Priority</th><th>Status</th><th>Agent</th><th>PR</th><th>Created</th><th></th><th></th></tr></thead><tbody>' +
@@ -1,5 +1,8 @@
1
1
  <section id="work-items-section" style="overflow:visible">
2
- <h2>Work Items <span class="count" id="wi-count">0</span> <button class="pr-pager-btn" style="font-size:9px;padding:2px 8px;margin-left:8px" onclick="toggleWorkItemArchive()">See Archive</button></h2>
3
- <div id="work-items-content"><p class="empty">No work items. Add tasks via Command Center above.</p></div>
2
+ <h2>Work Items <span class="count" id="wi-count">0</span>
3
+ <button class="pr-pager-btn" style="font-size:9px;padding:1px 6px;color:var(--green);border-color:var(--green);margin-left:8px" onclick="openCreateWorkItemModal()">+ New</button>
4
+ <button class="pr-pager-btn" style="font-size:9px;padding:2px 8px;margin-left:4px" onclick="toggleWorkItemArchive()">See Archive</button>
5
+ </h2>
6
+ <div id="work-items-content"><p class="empty">No work items yet.</p></div>
4
7
  <div id="work-items-archive" style="display:none;margin-top:12px"></div>
5
8
  </section>
package/dashboard.js CHANGED
@@ -2430,7 +2430,8 @@ What would you like to discuss or change? When you're happy, say "approve" and I
2430
2430
  let selectedPath = '';
2431
2431
  if (process.platform === 'win32') {
2432
2432
  // PowerShell STA with topmost window as owner — forces folder dialog to foreground
2433
- const ps = [
2433
+ // Write PS script to temp file to avoid shell quoting issues
2434
+ const psScript = [
2434
2435
  'Add-Type -AssemblyName System.Windows.Forms',
2435
2436
  '$f = New-Object System.Windows.Forms.FolderBrowserDialog',
2436
2437
  '$f.Description = "Select project folder"',
@@ -2443,8 +2444,13 @@ What would you like to discuss or change? When you're happy, say "approve" and I
2443
2444
  '$owner.Hide()',
2444
2445
  'if ($f.ShowDialog($owner) -eq "OK") { Write-Output $f.SelectedPath }',
2445
2446
  '$owner.Dispose()',
2446
- ].join('; ');
2447
- selectedPath = execSync(`powershell -STA -NoProfile -Command "${ps}"`, { encoding: 'utf8', timeout: 120000 }).trim();
2447
+ ].join('\r\n');
2448
+ const psPath = path.join(MINIONS_DIR, 'engine', 'tmp', '_browse.ps1');
2449
+ fs.mkdirSync(path.dirname(psPath), { recursive: true });
2450
+ fs.writeFileSync(psPath, psScript);
2451
+ try {
2452
+ selectedPath = execSync(`powershell -STA -NoProfile -ExecutionPolicy Bypass -File "${psPath}"`, { encoding: 'utf8', timeout: 120000 }).trim();
2453
+ } finally { try { fs.unlinkSync(psPath); } catch {} }
2448
2454
  } else if (process.platform === 'darwin') {
2449
2455
  selectedPath = execSync(`osascript -e 'POSIX path of (choose folder with prompt "Select project folder")'`, { encoding: 'utf8', timeout: 120000 }).trim();
2450
2456
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"