aegisai-harness 0.72.1 → 0.73.0

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to AegisAi Harness are documented here.
4
4
 
5
- ## [0.72.1] - 2026-11-24
5
+ ## [0.73.0] - 2026-11-24
6
6
 
7
7
  ### Fixed
8
8
  - Installation: Windows installer now preflights Node.js 22.13+ with actionable messages; launcher no longer hides npm failures, uses `--omit=dev`, and records a dependency marker. Inno uninstall removes stale `node_modules`/lockfiles; `install.ps1` preserves `data/` and handles GitHub source zips.
package/README.md CHANGED
@@ -10,7 +10,7 @@ A **feature-rich, local-only AI agent harness** — OpenCode-class runtime, but
10
10
  offline-first: no cloud dependencies, no telemetry. 66 milestones, ~200 modules,
11
11
  257 tests, CI green.
12
12
 
13
- > Status: v0.72.1 (see [ROADMAP.md](./ROADMAP.md)).
13
+ > Status: v0.73.0 (see [ROADMAP.md](./ROADMAP.md)).
14
14
  > **Successor to [aegisai-next](https://github.com/user6811992/aegisai-next)** — that project is deprecated; all features have been ported here.
15
15
  > **Live docs:** https://user6811992.github.io/aegisai-harness/
16
16
 
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # AegisAi Harness — agent-readable catalog
2
2
 
3
- A feature-rich, local-only AI agent harness. CLI-first, offline-first. v0.72.1.
3
+ A feature-rich, local-only AI agent harness. CLI-first, offline-first. v0.73.0.
4
4
 
5
5
  ## Capabilities
6
6
  - Multi-backend LLM adapter (Ollama + OpenAI-compatible + 18 providers)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aegisai-harness",
3
- "version": "0.72.1",
3
+ "version": "0.73.0",
4
4
  "description": "AegisAi Harness — feature-rich, local-only AI agent harness",
5
5
  "type": "commonjs",
6
6
  "main": "src/index.js",
@@ -4,13 +4,13 @@
4
4
  [Setup]
5
5
  AppId={{8F3D1B2A-6C4E-4B9A-9D21-AE615A010001}}
6
6
  AppName=AegisAi Harness
7
- AppVersion=0.72.1
7
+ AppVersion=0.73.0
8
8
  AppPublisher=AegisAi
9
9
  AppPublisherURL=https://github.com/user6811992/aegisai-harness
10
10
  DefaultDirName={autopf}\AegisAiHarness
11
11
  DefaultGroupName=AegisAi Harness
12
12
  OutputDir=..\..\dist
13
- OutputBaseFilename=AegisAi-Harness-0.72.1-Setup
13
+ OutputBaseFilename=AegisAi-Harness-0.73.0-Setup
14
14
  Compression=lzma2
15
15
  SolidCompression=yes
16
16
  PrivilegesRequired=lowest
package/public/app.js CHANGED
@@ -483,8 +483,38 @@ function App() {
483
483
  { icon: '🗑️', label: 'Clear Chat', keywords: 'clear reset', run: () => { setMessages([]); setToolLog([]); toast('Chat cleared', 'info'); } },
484
484
  { icon: '📊', label: 'Context Info', keywords: 'context tokens', run: () => toast('Context: ' + ctx.tokens + '/' + ctx.limit, 'info') },
485
485
  { icon: '🔧', label: 'Tools', keywords: 'tools list', run: () => toast('64+ tools available', 'info') },
486
+ { icon: '📤', label: 'Export Chat', keywords: 'export markdown json', run: () => exportChat('markdown') },
487
+ { icon: '⚖️', label: 'Compare Models', keywords: 'compare models', run: () => setShowCompare(true) },
486
488
  ];
487
489
 
490
+ const [showCompare, setShowCompare] = useState(false);
491
+ const [compareModels, setCompareModels] = useState('');
492
+ const [comparePrompt, setComparePrompt] = useState('');
493
+ const [compareResult, setCompareResult] = useState(null);
494
+ const [comparing, setComparing] = useState(false);
495
+
496
+ async function exportChat(format) {
497
+ try {
498
+ const r = await fetch('/api/export', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ format, title: 'Chat Export' }) });
499
+ const d = await r.json();
500
+ if (d.ok) toast('Exported to ' + d.path, 'success');
501
+ else toast('Export failed: ' + (d.error || 'unknown'), 'error');
502
+ } catch (e) { toast('Export failed: ' + e.message, 'error'); }
503
+ }
504
+
505
+ async function runCompare() {
506
+ if (!comparePrompt.trim() || !compareModels.trim()) { toast('Enter a prompt and models', 'error'); return; }
507
+ setComparing(true);
508
+ try {
509
+ const models = compareModels.split(',').map((m) => m.trim()).filter(Boolean);
510
+ const r = await fetch('/api/compare', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: comparePrompt, models }) });
511
+ const d = await r.json();
512
+ setCompareResult(d);
513
+ toast('Comparison complete', 'success');
514
+ } catch (e) { toast('Compare failed: ' + e.message, 'error'); }
515
+ setComparing(false);
516
+ }
517
+
488
518
  if (view === 'onboarding') {
489
519
  return html`<${OnboardingWizard} onComplete=${() => setView('chat')} />`;
490
520
  }
@@ -495,6 +525,34 @@ function App() {
495
525
  <${CommandPalette} open=${showPalette} onClose=${() => setShowPalette(false)} commands=${commands} />
496
526
  ${showConfig ? html`<${ConfigModal} cfg=${cfg} setCfg=${setCfg} onClose=${() => setShowConfig(false)} />` : null}
497
527
  ${showHelp ? html`<${HelpPanel} onClose=${() => setShowHelp(false)} />` : null}
528
+ ${showCompare ? html`
529
+ <div class="modal-backdrop" onClick=${() => setShowCompare(false)}>
530
+ <div class="modal" style="max-width: 800px" onClick=${(e) => e.stopPropagation()}>
531
+ <h2>Compare Models</h2>
532
+ <label>Prompt
533
+ <textarea value=${comparePrompt} onInput=${(e) => setComparePrompt(e.target.value)} placeholder="Enter a prompt to compare..." rows="3" style="width:100%;padding:8px;border:1px solid var(--border);border-radius:6px;background:var(--input);color:var(--fg)" />
534
+ </label>
535
+ <label>Models (comma-separated)
536
+ <input value=${compareModels} onInput=${(e) => setCompareModels(e.target.value)} placeholder="e.g. llama3.2:3b, mistral, phi3:mini" />
537
+ </label>
538
+ <div class="modal-actions">
539
+ <button class="btn-primary" onClick=${runCompare} disabled=${comparing}>${comparing ? 'Comparing...' : 'Compare'}</button>
540
+ <button onClick=${() => setShowCompare(false)}>Close</button>
541
+ </div>
542
+ ${compareResult ? html`
543
+ <div class="compare-results">
544
+ ${compareResult.comparison.results.map((r) => html`
545
+ <div class="compare-card">
546
+ <h3>${r.model} ${r.ok ? '✓' : '✗'} ${r.duration}ms</h3>
547
+ <div class="compare-reply">${r.ok ? r.reply.slice(0, 500) : r.error}</div>
548
+ </div>
549
+ `)}
550
+ <p class="hint">Fastest: ${compareResult.comparison.fastest} | Shortest: ${compareResult.comparison.shortest} | Longest: ${compareResult.comparison.longest}</p>
551
+ </div>
552
+ ` : null}
553
+ </div>
554
+ </div>
555
+ ` : null}
498
556
  <${SessionSidebar} open=${showSessions} onClose=${() => setShowSessions(false)} onSelect=${(s) => { toast('Loaded session: ' + (s.title || s.id), 'info'); }} />
499
557
  <header class="topbar">
500
558
  <h1>AegisAi Harness</h1>
@@ -503,6 +561,8 @@ function App() {
503
561
  <button onClick=${() => setTheme(theme === 'dark' ? 'light' : 'dark')} title="Toggle theme">${theme === 'dark' ? '☀️' : '🌙'}</button>
504
562
  <button onClick=${() => setShowConfig(true)} title="Settings (Ctrl+,)">⚙️</button>
505
563
  <button onClick=${() => setShowPalette(true)} title="Command palette (Ctrl+K)">⌘</button>
564
+ <button onClick=${() => exportChat('markdown')} title="Export chat as Markdown">📤</button>
565
+ <button onClick=${() => setShowCompare(true)} title="Compare models">⚖️</button>
506
566
  <button onClick=${() => setShowHelp(true)} title="Help (Ctrl+/)">?</button>
507
567
  </header>
508
568
  <div class="main-layout">
package/public/style.css CHANGED
@@ -250,6 +250,11 @@ kbd { background: var(--panel); border: 1px solid var(--border); border-radius:
250
250
  .scan-results, .hf-results { margin: 8px 0; max-height: 200px; overflow-y: auto; }
251
251
  .scan-item, .hf-item { display: flex; align-items: center; gap: 8px; padding: 6px; border-bottom: 1px solid var(--border); font-size: 12px; }
252
252
  .hf-item .model-name { flex: 1; }
253
+ /* Compare */
254
+ .compare-results { margin-top: 16px; max-height: 400px; overflow-y: auto; }
255
+ .compare-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
256
+ .compare-card h3 { margin: 0 0 8px; font-size: 13px; }
257
+ .compare-reply { font-size: 13px; line-height: 1.5; white-space: pre-wrap; max-height: 200px; overflow-y: auto; }
253
258
  /* Modal backdrop */
254
259
  .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px); }
255
260
 
@@ -0,0 +1,67 @@
1
+ // src/conversation_export.js
2
+ // Export conversations to Markdown, JSON, and PDF (text-based).
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ function toMarkdown(messages, meta) {
7
+ meta = meta || {};
8
+ const lines = [];
9
+ lines.push('# Conversation Export');
10
+ lines.push('');
11
+ if (meta.title) lines.push('**Title:** ' + meta.title);
12
+ if (meta.model) lines.push('**Model:** ' + meta.model);
13
+ if (meta.date) lines.push('**Date:** ' + meta.date);
14
+ lines.push('');
15
+ lines.push('---');
16
+ lines.push('');
17
+ for (const m of messages) {
18
+ const role = (m.role || 'unknown').charAt(0).toUpperCase() + (m.role || 'unknown').slice(1);
19
+ lines.push('## ' + role);
20
+ lines.push('');
21
+ lines.push(m.content || '');
22
+ lines.push('');
23
+ }
24
+ return lines.join('\n');
25
+ }
26
+
27
+ function toJSON(messages, meta) {
28
+ return JSON.stringify({ meta: meta || {}, messages: messages || [], exportedAt: new Date().toISOString() }, null, 2);
29
+ }
30
+
31
+ function toText(messages, meta) {
32
+ meta = meta || {};
33
+ const lines = [];
34
+ if (meta.title) lines.push('Title: ' + meta.title);
35
+ if (meta.model) lines.push('Model: ' + meta.model);
36
+ if (meta.date) lines.push('Date: ' + meta.date);
37
+ lines.push('');
38
+ for (const m of messages) {
39
+ lines.push('[' + (m.role || 'unknown').toUpperCase() + ']');
40
+ lines.push(m.content || '');
41
+ lines.push('');
42
+ }
43
+ return lines.join('\n');
44
+ }
45
+
46
+ // Simple PDF-like text output (not a real PDF, but a text file with .pdf extension for compatibility)
47
+ // For real PDF, would need a library. This produces a readable text document.
48
+ function toPDF(messages, meta) {
49
+ // Produce a simple text-based document that can be opened in any text editor
50
+ // In a real implementation, this would use a PDF library like pdfkit
51
+ const text = toText(messages, meta);
52
+ return { content: text, mimeType: 'text/plain', extension: '.txt', note: 'PDF generation requires pdfkit; returning text format' };
53
+ }
54
+
55
+ function exportToFile(messages, meta, format, outputPath) {
56
+ format = (format || 'markdown').toLowerCase();
57
+ let content, ext;
58
+ if (format === 'json') { content = toJSON(messages, meta); ext = '.json'; }
59
+ else if (format === 'text' || format === 'txt') { content = toText(messages, meta); ext = '.txt'; }
60
+ else if (format === 'pdf') { const r = toPDF(messages, meta); content = r.content; ext = r.extension; }
61
+ else { content = toMarkdown(messages, meta); ext = '.md'; }
62
+ const filePath = outputPath || path.join(process.cwd(), 'conversation-export' + ext);
63
+ fs.writeFileSync(filePath, content, 'utf8');
64
+ return { ok: true, path: filePath, format, bytes: Buffer.byteLength(content) };
65
+ }
66
+
67
+ module.exports = { toMarkdown, toJSON, toText, toPDF, exportToFile };
package/src/index.js CHANGED
@@ -281,6 +281,23 @@ async function main() {
281
281
  sendJson(res, 200, { models: found, backend });
282
282
  return;
283
283
  }
284
+ if (req.method === 'POST' && req.url.split('?')[0] === '/api/export') {
285
+ const parsed = await readJson(req);
286
+ const sid = parsed.sessionId || 'default';
287
+ const history = sessions.get(sid) || [];
288
+ const format = parsed.format || 'markdown';
289
+ const meta = { title: parsed.title, model: process.env.AEGISAI_MODEL || 'llama3.2:3b', date: new Date().toISOString() };
290
+ const result = require('./conversation_export').exportToFile(history.map((m) => ({ role: m.role, content: m.content })), meta, format, null);
291
+ sendJson(res, 200, result);
292
+ return;
293
+ }
294
+ if (req.method === 'POST' && req.url.split('?')[0] === '/api/compare') {
295
+ const parsed = await readJson(req);
296
+ const models = parsed.models || [process.env.AEGISAI_MODEL || 'llama3.2:3b'];
297
+ const result = await require('./model_compare').compare(parsed.prompt || '', models, { projectRoot: process.cwd() });
298
+ sendJson(res, 200, { comparison: result, formatted: require('./model_compare').formatComparison(result) });
299
+ return;
300
+ }
284
301
  if (req.method === 'GET' && req.url.split('?')[0] === '/api/models/hf-search') {
285
302
  const q = new URL(req.url, 'http://x').searchParams.get('q') || '';
286
303
  let results = [];
@@ -698,6 +715,8 @@ async function main() {
698
715
  if (t.startsWith('/think ')) { console.log(JSON.stringify(require('./sequential_thinking').think(t.slice(7).trim()), null, 2)); rl.prompt(); return; }
699
716
  if (t.startsWith('/fetch ')) { const r = await require('./fetch_url').fetch(t.slice(7).trim()); console.log(JSON.stringify(r, null, 2).slice(0, 2000)); rl.prompt(); return; }
700
717
  if (t === '/time') { console.log(JSON.stringify(require('./time_tool').now())); rl.prompt(); return; }
718
+ if (t.startsWith('/export ')) { const p = t.slice(8).trim().split('|').map((x) => x.trim()); const r = require('./conversation_export').exportToFile(lastToolLog.length ? [] : [], { title: p[1] || 'export', model: process.env.AEGISAI_MODEL || 'llama3.2:3b' }, p[0] || 'markdown', p[2]); console.log(JSON.stringify(r)); rl.prompt(); return; }
719
+ if (t.startsWith('/compare ')) { const p = t.slice(9).trim().split('|').map((x) => x.trim()); const r = await require('./model_compare').compare(p[0] || '', p.slice(1).filter(Boolean), { projectRoot: root }); console.log(require('./model_compare').formatComparison(r).slice(0, 3000)); rl.prompt(); return; }
701
720
  if (t.startsWith('/time ')) { console.log(JSON.stringify(require('./time_tool').now(t.slice(6).trim()))); rl.prompt(); return; }
702
721
  if (t.startsWith('/mcp-registry ')) { const r = await require('./mcp_registry_browser').browse(t.slice(14).trim()); console.log(JSON.stringify(r, null, 2).slice(0, 2000)); rl.prompt(); return; }
703
722
  if (t === '/everything-manifest') { console.log(JSON.stringify(require('./mcp_everything').manifest(), null, 2).slice(0, 1500)); rl.prompt(); return; }
@@ -0,0 +1,71 @@
1
+ // src/model_compare.js
2
+ // Multi-model comparison: send the same prompt to multiple models and compare responses.
3
+ const { runAgent } = require('./agent/run');
4
+
5
+ async function compare(prompt, models, opts) {
6
+ opts = opts || {};
7
+ const projectRoot = opts.projectRoot || process.cwd();
8
+ const results = [];
9
+ for (const model of models) {
10
+ const start = Date.now();
11
+ try {
12
+ const r = await runAgent({
13
+ model,
14
+ messages: [{ role: 'user', content: prompt }],
15
+ projectRoot,
16
+ onEvent: () => {},
17
+ autoApprove: true,
18
+ tokenBudgetTotal: opts.tokenBudget || 0,
19
+ });
20
+ const duration = Date.now() - start;
21
+ results.push({
22
+ model,
23
+ ok: true,
24
+ reply: (r.final && r.final.final) || '',
25
+ toolLog: r.toolLog || [],
26
+ tokenStats: r.final && r.final.tokenStats,
27
+ duration,
28
+ });
29
+ } catch (e) {
30
+ results.push({ model, ok: false, error: String(e.message || e), duration: Date.now() - start });
31
+ }
32
+ }
33
+ return {
34
+ prompt,
35
+ models,
36
+ results,
37
+ fastest: results.filter((r) => r.ok).sort((a, b) => a.duration - b.duration)[0]?.model,
38
+ shortest: results.filter((r) => r.ok).sort((a, b) => (a.reply || '').length - (b.reply || '').length)[0]?.model,
39
+ longest: results.filter((r) => r.ok).sort((a, b) => (b.reply || '').length - (a.reply || '').length)[0]?.model,
40
+ };
41
+ }
42
+
43
+ function formatComparison(comparison) {
44
+ const lines = [];
45
+ lines.push('# Multi-Model Comparison');
46
+ lines.push('');
47
+ lines.push('**Prompt:** ' + comparison.prompt);
48
+ lines.push('');
49
+ lines.push('**Models:** ' + comparison.models.join(', '));
50
+ lines.push('');
51
+ for (const r of comparison.results) {
52
+ lines.push('## ' + r.model);
53
+ lines.push('');
54
+ if (r.ok) {
55
+ lines.push(r.reply);
56
+ lines.push('');
57
+ lines.push(`_Duration: ${r.duration}ms | Tokens: ${r.tokenStats ? r.tokenStats.total : 'N/A'} | Tools: ${r.toolLog.length}_`);
58
+ } else {
59
+ lines.push('**Error:** ' + r.error);
60
+ }
61
+ lines.push('');
62
+ lines.push('---');
63
+ lines.push('');
64
+ }
65
+ if (comparison.fastest) lines.push('**Fastest:** ' + comparison.fastest);
66
+ if (comparison.shortest) lines.push('**Shortest response:** ' + comparison.shortest);
67
+ if (comparison.longest) lines.push('**Longest response:** ' + comparison.longest);
68
+ return lines.join('\n');
69
+ }
70
+
71
+ module.exports = { compare, formatComparison };
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // src/version.js — single runtime source for the version string.
2
2
  // Kept separate from package.json so bundled/npm-installed copies behave the same.
3
- const VERSION = '0.72.1';
3
+ const VERSION = '0.73.0';
4
4
  module.exports = { VERSION, version: VERSION };