mio-agent-runtime 0.9.0 → 0.11.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/README.md CHANGED
@@ -74,6 +74,7 @@ mio task record-outcome --outcome success Record a task outcome (--yes to appl
74
74
  mio --json status Machine-readable status
75
75
  mio --json agents Machine-readable agents
76
76
  mio --json evolution status Machine-readable evolution module health
77
+ mio --version Print the version and exit (-V)
77
78
  ```
78
79
 
79
80
  ## MCP 工具
package/bin/mio.js CHANGED
@@ -2797,6 +2797,14 @@ function observeCommand(args) {
2797
2797
  observer.startForeground(MIO_HOME)
2798
2798
  }
2799
2799
 
2800
+ function versionCommand(useJson) {
2801
+ // Read from the package manifest so the installed copy reports its own version
2802
+ // instead of a hardcoded string that drifts on every release.
2803
+ const pkg = require('../package.json')
2804
+ if (useJson) console.log(JSON.stringify({ name: pkg.name, version: pkg.version }))
2805
+ else console.log(pkg.version)
2806
+ }
2807
+
2800
2808
  function help() {
2801
2809
  console.log(`Mio Agent Runtime CLI
2802
2810
 
@@ -2860,6 +2868,7 @@ Usage:
2860
2868
  mio --json status Machine-readable status
2861
2869
  mio --json agents Machine-readable agents
2862
2870
  mio --json evolution status Machine-readable evolution module health
2871
+ mio --version Print the version and exit (-V)
2863
2872
  `)
2864
2873
  }
2865
2874
 
@@ -2915,6 +2924,9 @@ async function main() {
2915
2924
  return digestCommand(args, useJson)
2916
2925
  case 'evolution':
2917
2926
  return evolutionCommand(args, useJson)
2927
+ case '--version':
2928
+ case '-V':
2929
+ return versionCommand(useJson)
2918
2930
  case 'help':
2919
2931
  case '--help':
2920
2932
  return help()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mio-agent-runtime",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Mio Agent Runtime installer and MCP intelligence layer",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -190,6 +190,11 @@ class CreativityEngine {
190
190
  }
191
191
 
192
192
  async generate(sourceLabels, strategy) {
193
+ // A missing sources array used to reach .map() and surface as
194
+ // "Cannot read properties of undefined", which tells the caller nothing.
195
+ if (!Array.isArray(sourceLabels)) {
196
+ throw new Error('creativity.generate requires sources: an array of { name, content } entries')
197
+ }
193
198
  const sources = sourceLabels.map(s => ({
194
199
  name: s.name || 'unnamed',
195
200
  content: s.content || '',
@@ -180,7 +180,11 @@ function createObserverStore(options = {}) {
180
180
  // `collected: 0` no matter how much the collectors actually returned.
181
181
  async function collect(args = {}) {
182
182
  if (!ObserverService) throw new Error('@akemi-mio/observer not installed')
183
- const service = new ObserverService({ baseDir: baseDirOf(args), collectorConfig: {} })
183
+ // ObserverService takes the base dir as a bare string -- passing an options
184
+ // object made path.resolve() throw before any collector ran, so collect()
185
+ // was dead on arrival for every caller. (collectorConfig was never read by
186
+ // the package; it was invented here.)
187
+ const service = new ObserverService(baseDirOf(args))
184
188
  const sources = args.sources || ['bilibili', 'hackernews', 'github', 'douyin', 'rss']
185
189
  const allObs = []
186
190
  for (const src of sources) {
@@ -206,7 +210,7 @@ function createObserverStore(options = {}) {
206
210
 
207
211
  async function ferment(args = {}) {
208
212
  if (!ObserverService) throw new Error('@akemi-mio/observer not installed')
209
- const service = new ObserverService({ baseDir: baseDirOf(args), collectorConfig: {} })
213
+ const service = new ObserverService(baseDirOf(args))
210
214
  const session = args.session || 'afternoon'
211
215
  try {
212
216
  const fermentation = service.getFermentation()