mio-agent-runtime 0.5.11 → 0.5.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.
@@ -55,8 +55,8 @@ function runHermes(args) {
55
55
  try {
56
56
  const isCmdShim = Boolean(bin && /\.(cmd|bat)$/i.test(bin))
57
57
  res = bin
58
- ? spawnSync(bin, args, { encoding: 'utf8', timeout: 60000, windowsHide: true, input: input, shell: isCmdShim })
59
- : spawnSync('hermes', args, { encoding: 'utf8', timeout: 60000, shell: true, windowsHide: true, input: input })
58
+ ? spawnSync(bin, args, { encoding: 'utf8', timeout: 60000, windowsHide: true, input: input, shell: isCmdShim, cwd: hermesHome() })
59
+ : spawnSync('hermes', args, { encoding: 'utf8', timeout: 60000, shell: true, windowsHide: true, input: input, cwd: hermesHome() })
60
60
  } catch (_) {
61
61
  return null
62
62
  }
@@ -300,7 +300,10 @@ function updateProjectContext(state, cwd, line) {
300
300
  content = content.trimEnd() + '\n\n' + block + '\n'
301
301
  fs.mkdirSync(path.dirname(target), { recursive: true })
302
302
  fs.writeFileSync(target, content, 'utf8')
303
- } catch (_) {}
303
+ log(homeDir(), 'write-back OK: MIO_CONTEXT -> ' + target)
304
+ } catch (e) {
305
+ log(homeDir(), 'write-back FAIL: MIO_CONTEXT -> ' + target + ': ' + (e && e.message || e))
306
+ }
304
307
  }
305
308
 
306
309
  function localDateKey(ts) {
@@ -326,7 +329,10 @@ function writeWorkbuddyDigest(turn, outcome, summary) {
326
329
  '\n## Mio 自动摘要 (' + time + ')\n' +
327
330
  '- outcome: ' + outcome + ' | tools: ' + turn.toolCount + ' | ' + summary.slice(0, 160) + '\n'
328
331
  fs.appendFileSync(file, entry, 'utf8')
329
- } catch (_) {}
332
+ log(homeDir(), 'write-back OK: workbuddy digest -> ' + file)
333
+ } catch (e) {
334
+ log(homeDir(), 'write-back FAIL: workbuddy digest -> ' + file + ': ' + (e && e.message || e))
335
+ }
330
336
  }
331
337
 
332
338
  function emitWorkbuddyOutcome(turn, sinks, state) {
@@ -370,6 +376,7 @@ function emitWorkbuddyOutcome(turn, sinks, state) {
370
376
  project: turn.project,
371
377
  source: 'workbuddy-observer',
372
378
  })
379
+ log(homeDir(), '[workbuddy] write-back: ' + memLabel + ' -> memory + ' + (turn.cwd || '?') + '/AGENTS.md')
373
380
  writeWorkbuddyDigest(turn, outcome, summary)
374
381
  var ctxTime = new Date(Number(turn.ts) || Date.now()).toLocaleString('zh-CN', { hour12: false })
375
382
  updateProjectContext(state, turn.cwd, ctxTime + ' | ' + outcome + ' | ' + summary.slice(0, 80))
@@ -800,6 +807,7 @@ function emitOpencodeOutcome(turn, sinks, state) {
800
807
  project: turn.project,
801
808
  source: 'opencode-observer',
802
809
  })
810
+ log(homeDir(), '[opencode] write-back: ' + memLabel + ' -> memory + ' + (turn.cwd || '?') + '/AGENTS.md')
803
811
  var ctxTime = new Date(Number(turn.ts) || Date.now()).toLocaleString('zh-CN', { hour12: false })
804
812
  updateProjectContext(state, turn.cwd, ctxTime + ' | ' + outcome + ' | ' + summary.slice(0, 80))
805
813
  }
@@ -1060,6 +1068,7 @@ function emitHermesOutcome(turn, sinks, state) {
1060
1068
  project: turn.project,
1061
1069
  source: 'hermes-observer',
1062
1070
  })
1071
+ log(homeDir(), '[hermes] write-back: ' + memLabel + ' -> memory')
1063
1072
  // Hermes reads AGENTS.md Context Files; write back only into a real repo
1064
1073
  // workspace so we never pollute the user's home directory.
1065
1074
  if (turn.cwd) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mio-agent-runtime",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
4
4
  "description": "Mio Agent Runtime installer and MCP intelligence layer",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",