openrune 0.3.4 → 0.3.6

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/bin/rune.js CHANGED
@@ -765,31 +765,52 @@ function runRune(file, restArgs) {
765
765
 
766
766
  let fullOutput = ''
767
767
 
768
+ let buffer = ''
768
769
  child.stdout.on('data', (data) => {
769
- const lines = data.toString().split('\n').filter(Boolean)
770
+ buffer += data.toString()
771
+ const lines = buffer.split('\n')
772
+ buffer = lines.pop() // keep incomplete line in buffer
770
773
  for (const line of lines) {
774
+ if (!line.trim()) continue
771
775
  try {
772
776
  const event = JSON.parse(line)
773
777
 
774
- if (event.type === 'assistant' && event.subtype === 'tool_use') {
775
- const tool = event.tool_name || event.name || 'unknown'
776
- const input = event.input || {}
777
- if (tool === 'Bash') {
778
- console.log(` ▶ Bash: ${(input.command || '').slice(0, 120)}`)
779
- } else if (tool === 'Write') {
780
- console.log(` ▶ Write: ${input.file_path || ''}`)
781
- } else if (tool === 'Edit') {
782
- console.log(` ▶ Edit: ${input.file_path || ''}`)
783
- } else if (tool === 'Read') {
784
- console.log(` ▶ Read: ${input.file_path || ''}`)
785
- } else {
786
- console.log(` ▶ ${tool}`)
778
+ // Tool use events
779
+ if (event.type === 'assistant' && event.message && event.message.content) {
780
+ for (const block of event.message.content) {
781
+ if (block.type === 'tool_use') {
782
+ const tool = block.name || 'unknown'
783
+ const input = block.input || {}
784
+ if (tool === 'Bash') {
785
+ console.log(` ▶ Bash: ${(input.command || '').slice(0, 120)}`)
786
+ } else if (tool === 'Write') {
787
+ console.log(` ▶ Write: ${input.file_path || ''}`)
788
+ } else if (tool === 'Edit') {
789
+ console.log(` ▶ Edit: ${input.file_path || ''}`)
790
+ } else if (tool === 'Read') {
791
+ console.log(` ▶ Read: ${input.file_path || ''}`)
792
+ } else if (tool === 'Grep') {
793
+ console.log(` ▶ Grep: ${input.pattern || ''}`)
794
+ } else if (tool === 'Glob') {
795
+ console.log(` ▶ Glob: ${input.pattern || ''}`)
796
+ } else {
797
+ console.log(` ▶ ${tool}`)
798
+ }
799
+ } else if (block.type === 'text' && block.text && block.text.trim()) {
800
+ console.log(` 💬 ${block.text.trim().slice(0, 200)}`)
801
+ }
787
802
  }
788
803
  }
789
804
 
805
+ // Tool results
806
+ if (event.type === 'user' && event.tool_use_result) {
807
+ // silently track tool results
808
+ }
809
+
810
+ // Final result
790
811
  if (event.type === 'result') {
791
812
  fullOutput = event.result || ''
792
- console.log(`\n${fullOutput}`)
813
+ if (fullOutput) console.log(`\n${fullOutput}`)
793
814
  }
794
815
  } catch {}
795
816
  }
package/bootstrap.js CHANGED
@@ -1,4 +1,8 @@
1
- // Simple entry point just load the bundled main process
2
- // Note: require('electron') works because Electron intercepts
3
- // the npm package resolution and returns its built-in module
4
- require('./dist/main.js')
1
+ // When loaded via Electron, start the desktop app
2
+ // When loaded via require('openrune'), export the Node.js API
3
+ try {
4
+ require('electron')
5
+ require('./dist/main.js')
6
+ } catch {
7
+ module.exports = require('./lib/index.js')
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrune",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Rune — File-based AI Agent Harness for Claude Code",
5
5
  "keywords": ["ai", "agent", "claude", "desktop", "electron", "mcp", "claude-code", "harness", "automation"],
6
6
  "repository": {