mio-agent-runtime 0.5.12 → 0.5.13
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/README.md +1 -0
- package/package.json +1 -1
- package/server/mio-intelligence-mcp/index.js +84 -0
package/README.md
CHANGED
|
@@ -244,6 +244,7 @@ WorkBuddy ─┘ + Observer ......... automatic data collection
|
|
|
244
244
|
| >= 0.5.9 | `mio uninstall <host>` command |
|
|
245
245
|
| >= 0.5.10 | `mio upgrade` and `mio doctor` commands |
|
|
246
246
|
| >= 0.5.11 | Live web dashboard (`mio dashboard` + `mio.dashboard.*`) |
|
|
247
|
+
| >= 0.5.12 | Observer reliability: all outcomes write back (not just success); Hermes cwd hardening; write-back diagnostics |
|
|
247
248
|
|
|
248
249
|
---
|
|
249
250
|
|
package/package.json
CHANGED
|
@@ -1662,6 +1662,90 @@ const TOOLS = [
|
|
|
1662
1662
|
},
|
|
1663
1663
|
]
|
|
1664
1664
|
|
|
1665
|
+
function handleIdeaGenerate(args = {}) {
|
|
1666
|
+
const goal = String(args.goal || '').trim()
|
|
1667
|
+
if (!goal) throw new Error('idea.generate requires a goal')
|
|
1668
|
+
const numIdeas = Math.min(Math.max(Number(args.numIdeas) || 3, 1), 10)
|
|
1669
|
+
const context = args.context ? String(args.context).trim() : ''
|
|
1670
|
+
const constraints = Array.isArray(args.constraints) ? args.constraints.map(String) : []
|
|
1671
|
+
|
|
1672
|
+
// Query Mio memory for related context
|
|
1673
|
+
const relatedRecords = readJsonl(memoryPath)
|
|
1674
|
+
.filter(r => r.archived !== true)
|
|
1675
|
+
.filter(r => {
|
|
1676
|
+
const text = (r.content || '').toLowerCase()
|
|
1677
|
+
const goalWords = goal.toLowerCase().split(/\s+/).filter(w => w.length > 2)
|
|
1678
|
+
return goalWords.some(w => text.includes(w))
|
|
1679
|
+
})
|
|
1680
|
+
.slice(0, 8)
|
|
1681
|
+
|
|
1682
|
+
const relatedMemoryText = relatedRecords.length > 0
|
|
1683
|
+
? relatedRecords.map(r => '- [' + r.kind + '] ' + (r.content || '').slice(0, 200)).join('\n')
|
|
1684
|
+
: '(no related memories found)'
|
|
1685
|
+
|
|
1686
|
+
const strategies = [
|
|
1687
|
+
{
|
|
1688
|
+
name: 'SCAMPER',
|
|
1689
|
+
prompt: 'Apply SCAMPER: Substitute, Combine, Adapt, Modify, Put to another use, Eliminate, Reverse. ' +
|
|
1690
|
+
'For goal: ' + goal + '. What novel combination or modification of existing elements could work?'
|
|
1691
|
+
},
|
|
1692
|
+
{
|
|
1693
|
+
name: 'Analogy',
|
|
1694
|
+
prompt: 'By analogy: What similar problem has been solved in a completely different domain? ' +
|
|
1695
|
+
'For goal: ' + goal + '. What approach from another field (biology, economics, gaming, logistics) transfers here?'
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
name: 'First-Principles',
|
|
1699
|
+
prompt: 'First principles: Strip away all assumptions. What are the absolute basics of ' + goal + '? ' +
|
|
1700
|
+
'What would you build if you had no prior art, no constraints, no legacy?'
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
name: 'Random-Stimulus',
|
|
1704
|
+
prompt: 'Random stimulus: Pick an unrelated concept (a relay race, a restaurant menu, a river delta, a beehive). ' +
|
|
1705
|
+
'How does it relate to ' + goal + '? What structural or procedural parallel exists?'
|
|
1706
|
+
},
|
|
1707
|
+
{
|
|
1708
|
+
name: 'Constraint-Inversion',
|
|
1709
|
+
prompt: 'Constraint inversion: Instead of ' + goal + ', what is the OPPOSITE goal? ' +
|
|
1710
|
+
'How would you deliberately make things worse? Now invert the inversion — what does that reveal about the real solution?'
|
|
1711
|
+
}
|
|
1712
|
+
]
|
|
1713
|
+
|
|
1714
|
+
const selectedStrategies = strategies.slice(0, numIdeas)
|
|
1715
|
+
const ideas = []
|
|
1716
|
+
|
|
1717
|
+
for (let i = 0; i < selectedStrategies.length; i++) {
|
|
1718
|
+
const s = selectedStrategies[i]
|
|
1719
|
+
const idea = {
|
|
1720
|
+
id: createId('idea'),
|
|
1721
|
+
title: 'Idea #' + (i + 1) + ' (' + s.name + '): ' + goal,
|
|
1722
|
+
description: 'Goal: ' + goal + '\n\n' +
|
|
1723
|
+
'Strategy: ' + s.name + '\n\n' +
|
|
1724
|
+
'Related Mio memory:\n' + relatedMemoryText + '\n\n' +
|
|
1725
|
+
(context ? 'Context: ' + context + '\n\n' : '') +
|
|
1726
|
+
(constraints.length > 0 ? 'Constraints:\n' + constraints.map(c => '- ' + c).join('\n') + '\n\n' : '') +
|
|
1727
|
+
'Strategy prompt: ' + s.prompt + '\n\n' +
|
|
1728
|
+
'Suggestion: Consider prototyping the idea and measuring its impact against prior decisions.',
|
|
1729
|
+
provenance: {
|
|
1730
|
+
strategy: s.name,
|
|
1731
|
+
relatedMemoryIds: relatedRecords.map(r => r.id).slice(0, 5),
|
|
1732
|
+
},
|
|
1733
|
+
generatedAt: new Date().toISOString(),
|
|
1734
|
+
goal,
|
|
1735
|
+
context: context || null,
|
|
1736
|
+
constraints,
|
|
1737
|
+
}
|
|
1738
|
+
ideas.push(idea)
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
// Persist to ideas.jsonl
|
|
1742
|
+
for (const idea of ideas) {
|
|
1743
|
+
appendJsonl(ideasPath, idea)
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
return { ideas, count: ideas.length, goal, strategies: ideas.map(i => i.provenance.strategy) }
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1665
1749
|
function listIdeas(args = {}) {
|
|
1666
1750
|
if (!fs.existsSync(ideasPath)) return { ideas: [], count: 0, total: 0 }
|
|
1667
1751
|
const now = Date.now()
|